summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x.rr.yaml6
-rw-r--r--cmd/cli/workers.go9
-rw-r--r--cmd/main.go4
-rwxr-xr-xcmd/rrbin25579539 -> 0 bytes
-rwxr-xr-xgo.mod7
-rwxr-xr-xgo.sum2
6 files changed, 19 insertions, 9 deletions
diff --git a/.rr.yaml b/.rr.yaml
index 3154f5b4..39199b86 100755
--- a/.rr.yaml
+++ b/.rr.yaml
@@ -13,18 +13,18 @@ server:
logs:
mode: development
- level: debug
+ level: error
http:
debug: true
- address: 127.0.0.1:18903
+ address: 127.0.0.1:44933
maxRequestSize: 1024
middleware: [ "gzip", "headers" ]
uploads:
forbid: [ ".php", ".exe", ".bat" ]
trustedSubnets: [ "10.0.0.0/8", "127.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16", "::1/128", "fc00::/7", "fe80::/10" ]
pool:
- numWorkers: 3
+ numWorkers: 6
maxJobs: 0
allocateTimeout: 60s
destroyTimeout: 60s
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
diff --git a/go.mod b/go.mod
index be16ada8..cc86f14e 100755
--- a/go.mod
+++ b/go.mod
@@ -23,16 +23,15 @@ require (
github.com/spiral/roadrunner-plugins/reload v1.0.1
github.com/spiral/roadrunner-plugins/resetter v1.0.0
github.com/spiral/roadrunner-plugins/rpc v1.0.1
- github.com/spiral/roadrunner-plugins/server v1.0.3
+ github.com/spiral/roadrunner-plugins/server v1.0.4
github.com/stretchr/testify v1.6.1
github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a
github.com/vbauerster/mpb/v5 v5.4.0
go.uber.org/multierr v1.6.0
- go.uber.org/zap v1.16.0
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a
)
-replace github.com/spiral/roadrunner-plugins/http v1.0.2 => ../roadrunner-plugins/http
+//replace github.com/spiral/roadrunner-plugins/http v1.0.2 => ../roadrunner-plugins/http
//replace github.com/spiral/roadrunner-plugins/reload v1.0.0 => ../roadrunner-plugins/reload
//replace github.com/spiral/roadrunner-plugins/rpc v1.0.0 => ../roadrunner-plugins/rpc
-replace github.com/spiral/roadrunner-plugins/server v1.0.3 => ../roadrunner-plugins/server
+//replace github.com/spiral/roadrunner-plugins/server v1.0.3 => ../roadrunner-plugins/server
diff --git a/go.sum b/go.sum
index 0563a7d2..fb358b24 100755
--- a/go.sum
+++ b/go.sum
@@ -447,6 +447,8 @@ github.com/spiral/roadrunner-plugins/server v1.0.1 h1:yzCw5rgz+KHpJb56QIID3gWH/I
github.com/spiral/roadrunner-plugins/server v1.0.1/go.mod h1:qedfnQFlK1+Jwv5M8mRXJCOWTvF/qfFyULK/0UMBeOk=
github.com/spiral/roadrunner-plugins/server v1.0.3 h1:Bhr5tK0eW+52/qeew6QMowowOpeUKJv/qqECCmW1X+Y=
github.com/spiral/roadrunner-plugins/server v1.0.3/go.mod h1:XHfOZwvITuKyUwU79KaeMm8gU5AqzKQg0MCHJ7eBU5c=
+github.com/spiral/roadrunner-plugins/server v1.0.4 h1:i6QWbVM/gLnM3Tb/DDFSFpRnxccJd3mCpENW2rBuTeE=
+github.com/spiral/roadrunner-plugins/server v1.0.4/go.mod h1:XHfOZwvITuKyUwU79KaeMm8gU5AqzKQg0MCHJ7eBU5c=
github.com/spiral/roadrunner/v2 v2.0.0-alpha26/go.mod h1:r7ojuHm9qCVbg4fKcqr4Aqk7VXqZ9YPefr1LOv7HNys=
github.com/spiral/roadrunner/v2 v2.0.0-alpha28/go.mod h1:Uqtk/47S+qweVjSl4R9XVImEVZc3nMWku4yg3A+f18Q=
github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw=