diff options
author | Wolfy-J <[email protected]> | 2018-06-11 12:38:39 +0300 |
---|---|---|
committer | Wolfy-J <[email protected]> | 2018-06-11 12:38:39 +0300 |
commit | 72f81fe1d46ab43e24e9a5c23c5ca54bfe6d701d (patch) | |
tree | 3a94b89ae0ce897d9234de98d95c3cc9bd266a11 /cmd/rr/http | |
parent | efcddcc8d1b676c64cbd41a5f645bd046ba416d7 (diff) |
no more updated
Diffstat (limited to 'cmd/rr/http')
-rw-r--r-- | cmd/rr/http/workers.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/cmd/rr/http/workers.go b/cmd/rr/http/workers.go index 394874fa..d04e37fb 100644 --- a/cmd/rr/http/workers.go +++ b/cmd/rr/http/workers.go @@ -36,6 +36,8 @@ import ( "os" "strconv" "time" + "os/signal" + "syscall" ) var ( @@ -59,6 +61,9 @@ func init() { ) rr.CLI.AddCommand(workersCommand) + + signal.Notify(stopSignal, syscall.SIGTERM) + signal.Notify(stopSignal, syscall.SIGINT) } func workersHandler(cmd *cobra.Command, args []string) (err error) { @@ -87,6 +92,8 @@ func workersHandler(cmd *cobra.Command, args []string) (err error) { tm.Clear() for { select { + case <-stopSignal: + return nil case <-time.NewTicker(time.Millisecond * 500).C: tm.MoveCursor(1, 1) showWorkers(client) @@ -94,7 +101,6 @@ func workersHandler(cmd *cobra.Command, args []string) (err error) { } } - <-stopSignal return nil } |