From d29c605f9909116d576c61e1dd938f2e658c44c7 Mon Sep 17 00:00:00 2001 From: yory8 <> Date: Thu, 4 Apr 2019 10:23:41 +0200 Subject: [PATCH] Revert buggy "feat: exit cleanly on sigterm/siginterr" This reverts commit 3b9d475e89925779d6c4adfd829d6cdf5f290435. --- main.go | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/main.go b/main.go index 6770a6d..31b8ac1 100644 --- a/main.go +++ b/main.go @@ -5,9 +5,7 @@ import ( "io/ioutil" "log" "os" - "os/signal" "path" - "syscall" "gopkg.in/alecthomas/kingpin.v2" ) @@ -42,20 +40,6 @@ func main() { } if *asDemon { - // exit cleanly on ctrl-C or kill - c := make(chan os.Signal, 1) - signal.Notify(c, os.Interrupt, syscall.SIGTERM) - go func() { - for range c { - // dump history to file so that other apps can query it - err = write(history, histfile) - if err != nil { - log.Fatal(err) - } - os.Exit(0) - } - }() - persist := !*noPersist if err := listen(history, histfile, persist, *max); err != nil { log.Fatal(err)