summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2020-12-24 10:39:05 +0300
committerValery Piashchynski <[email protected]>2020-12-24 10:39:05 +0300
commit62ee1770cc233328300438ffd690ea1d8fc747bb (patch)
treeadc7d78e28a9512cb1b1ba85cb4f19dec7d1323d /cmd
parente78c13d93a729a9008f283aa3db6910f3e833165 (diff)
Remove local replace in the go.mod
Diffstat (limited to 'cmd')
-rw-r--r--cmd/cli/workers.go9
-rw-r--r--cmd/main.go4
-rwxr-xr-xcmd/rrbin25579539 -> 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
deleted file mode 100755
index b6fd15f4..00000000
--- a/cmd/rr
+++ /dev/null
Binary files differ