From 8d1e79d22e64ae2fc7a390683bfef1b1957148be Mon Sep 17 00:00:00 2001 From: Roy Crihfield Date: Wed, 16 Mar 2022 18:48:51 +0800 Subject: [PATCH] handle sigterm --- pkg/snapshot/tracker.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/snapshot/tracker.go b/pkg/snapshot/tracker.go index 4ff7634..8f7d643 100644 --- a/pkg/snapshot/tracker.go +++ b/pkg/snapshot/tracker.go @@ -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)