diff options
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/cli/workers.go | 9 | ||||
-rw-r--r-- | cmd/main.go | 4 | ||||
-rwxr-xr-x | cmd/rr | bin | 25579539 -> 0 bytes |
3 files changed, 11 insertions, 2 deletions
diff --git a/cmd/cli/workers.go b/cmd/cli/workers.go index 4bcbbdbd..d34de40a 100644 --- a/cmd/cli/workers.go +++ b/cmd/cli/workers.go @@ -5,6 +5,8 @@ import ( "log" "net/rpc" "os" + "os/signal" + "syscall" "time" tm "github.com/buger/goterm" @@ -68,11 +70,18 @@ func workersHandler(cmd *cobra.Command, args []string) error { return showWorkers(plugins, client) } + // https://golang.org/pkg/os/signal/#Notify + // should be of buffer size at least 1 + c := make(chan os.Signal, 1) + signal.Notify(c, os.Interrupt, syscall.SIGTERM, syscall.SIGINT) + tm.Clear() tt := time.NewTicker(time.Second) defer tt.Stop() for { select { + case <-c: + return nil case <-tt.C: tm.MoveCursor(1, 1) err := showWorkers(plugins, client) diff --git a/cmd/main.go b/cmd/main.go index ac98c5a8..8151d4fe 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -18,9 +18,9 @@ import ( func main() { var err error - cli.Container, err = endure.NewContainer(nil, endure.SetLogLevel(endure.DebugLevel), endure.RetryOnFail(false)) + cli.Container, err = endure.NewContainer(nil, endure.SetLogLevel(endure.ErrorLevel), endure.RetryOnFail(false)) if err != nil { - return + log.Fatal(err) } err = cli.Container.RegisterAll( diff --git a/cmd/rr b/cmd/rr Binary files differdeleted file mode 100755 index b6fd15f4..00000000 --- a/cmd/rr +++ /dev/null |