handle sigterm
This commit is contained in:
parent
b732ffc5f2
commit
8d1e79d22e
@ -53,7 +53,7 @@ func newTracker(file string, buf int) iteratorTracker {
|
|||||||
func (tr *iteratorTracker) captureSignal() {
|
func (tr *iteratorTracker) captureSignal() {
|
||||||
sigChan := make(chan os.Signal, 1)
|
sigChan := make(chan os.Signal, 1)
|
||||||
|
|
||||||
signal.Notify(sigChan, syscall.SIGINT)
|
signal.Notify(sigChan, syscall.SIGINT, syscall.SIGTERM)
|
||||||
go func() {
|
go func() {
|
||||||
sig := <-sigChan
|
sig := <-sigChan
|
||||||
log.Errorf("Signal received (%v), stopping", sig)
|
log.Errorf("Signal received (%v), stopping", sig)
|
||||||
|
Loading…
Reference in New Issue
Block a user