handle sigterm

This commit is contained in:
Roy Crihfield 2022-03-16 18:48:51 +08:00
parent b732ffc5f2
commit 8d1e79d22e

View File

@ -53,7 +53,7 @@ func newTracker(file string, buf int) iteratorTracker {
func (tr *iteratorTracker) captureSignal() {
sigChan := make(chan os.Signal, 1)
signal.Notify(sigChan, syscall.SIGINT)
signal.Notify(sigChan, syscall.SIGINT, syscall.SIGTERM)
go func() {
sig := <-sigChan
log.Errorf("Signal received (%v), stopping", sig)