summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd/rr/cmd/root.go2
-rw-r--r--cmd/rr/cmd/stop.go2
-rw-r--r--cmd/rr/http/debug.go4
-rw-r--r--cmd/rr/http/metrics.go2
-rw-r--r--cmd/rr/http/reset.go4
-rw-r--r--cmd/rr/http/workers.go4
-rw-r--r--cmd/rr/limit/debug.go4
-rw-r--r--cmd/rr/limit/metrics.go2
-rw-r--r--cmd/rr/main.go6
-rw-r--r--service/reload/service.go8
10 files changed, 20 insertions, 18 deletions
diff --git a/cmd/rr/cmd/root.go b/cmd/rr/cmd/root.go
index a1b1d642..456cfc6a 100644
--- a/cmd/rr/cmd/root.go
+++ b/cmd/rr/cmd/root.go
@@ -23,9 +23,9 @@ package cmd
import (
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
+ "github.com/spiral/roadrunner/cmd/util"
"github.com/spiral/roadrunner/service"
"github.com/spiral/roadrunner/service/limit"
- "github.com/spiral/roadrunner/service/reload/cmd/util"
"log"
"net/http"
"net/http/pprof"
diff --git a/cmd/rr/cmd/stop.go b/cmd/rr/cmd/stop.go
index 36f28c6d..7b4794e7 100644
--- a/cmd/rr/cmd/stop.go
+++ b/cmd/rr/cmd/stop.go
@@ -22,7 +22,7 @@ package cmd
import (
"github.com/spf13/cobra"
- "github.com/spiral/roadrunner/service/reload/cmd/util"
+ "github.com/spiral/roadrunner/cmd/util"
)
func init() {
diff --git a/cmd/rr/http/debug.go b/cmd/rr/http/debug.go
index 5dfbedc3..ae383e8d 100644
--- a/cmd/rr/http/debug.go
+++ b/cmd/rr/http/debug.go
@@ -5,9 +5,9 @@ import (
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/spiral/roadrunner"
+ rr "github.com/spiral/roadrunner/cmd/rr/cmd"
+ "github.com/spiral/roadrunner/cmd/util"
rrhttp "github.com/spiral/roadrunner/service/http"
- rr "github.com/spiral/roadrunner/service/reload/cmd/rr/cmd"
- "github.com/spiral/roadrunner/service/reload/cmd/util"
"net"
"net/http"
"strings"
diff --git a/cmd/rr/http/metrics.go b/cmd/rr/http/metrics.go
index df093921..21bbbaf1 100644
--- a/cmd/rr/http/metrics.go
+++ b/cmd/rr/http/metrics.go
@@ -3,9 +3,9 @@ package http
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/spf13/cobra"
+ rr "github.com/spiral/roadrunner/cmd/rr/cmd"
rrhttp "github.com/spiral/roadrunner/service/http"
"github.com/spiral/roadrunner/service/metrics"
- rr "github.com/spiral/roadrunner/service/reload/cmd/rr/cmd"
"github.com/spiral/roadrunner/util"
"strconv"
"time"
diff --git a/cmd/rr/http/reset.go b/cmd/rr/http/reset.go
index d5c45338..3008848a 100644
--- a/cmd/rr/http/reset.go
+++ b/cmd/rr/http/reset.go
@@ -22,8 +22,8 @@ package http
import (
"github.com/spf13/cobra"
- rr "github.com/spiral/roadrunner/service/reload/cmd/rr/cmd"
- "github.com/spiral/roadrunner/service/reload/cmd/util"
+ rr "github.com/spiral/roadrunner/cmd/rr/cmd"
+ "github.com/spiral/roadrunner/cmd/util"
)
func init() {
diff --git a/cmd/rr/http/workers.go b/cmd/rr/http/workers.go
index faf07fd0..4444b87f 100644
--- a/cmd/rr/http/workers.go
+++ b/cmd/rr/http/workers.go
@@ -23,9 +23,9 @@ package http
import (
tm "github.com/buger/goterm"
"github.com/spf13/cobra"
+ rr "github.com/spiral/roadrunner/cmd/rr/cmd"
+ "github.com/spiral/roadrunner/cmd/util"
"github.com/spiral/roadrunner/service/http"
- rr "github.com/spiral/roadrunner/service/reload/cmd/rr/cmd"
- "github.com/spiral/roadrunner/service/reload/cmd/util"
"net/rpc"
"os"
"os/signal"
diff --git a/cmd/rr/limit/debug.go b/cmd/rr/limit/debug.go
index 0a0c7f76..b9d919dc 100644
--- a/cmd/rr/limit/debug.go
+++ b/cmd/rr/limit/debug.go
@@ -4,9 +4,9 @@ import (
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/spiral/roadrunner"
+ rr "github.com/spiral/roadrunner/cmd/rr/cmd"
+ "github.com/spiral/roadrunner/cmd/util"
"github.com/spiral/roadrunner/service/limit"
- rr "github.com/spiral/roadrunner/service/reload/cmd/rr/cmd"
- "github.com/spiral/roadrunner/service/reload/cmd/util"
)
func init() {
diff --git a/cmd/rr/limit/metrics.go b/cmd/rr/limit/metrics.go
index edce6e1a..947f53fe 100644
--- a/cmd/rr/limit/metrics.go
+++ b/cmd/rr/limit/metrics.go
@@ -3,9 +3,9 @@ package limit
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/spf13/cobra"
+ rr "github.com/spiral/roadrunner/cmd/rr/cmd"
rrlimit "github.com/spiral/roadrunner/service/limit"
"github.com/spiral/roadrunner/service/metrics"
- rr "github.com/spiral/roadrunner/service/reload/cmd/rr/cmd"
)
func init() {
diff --git a/cmd/rr/main.go b/cmd/rr/main.go
index f6b15b92..54a1f060 100644
--- a/cmd/rr/main.go
+++ b/cmd/rr/main.go
@@ -23,7 +23,7 @@
package main
import (
- rr "github.com/spiral/roadrunner/service/reload/cmd/rr/cmd"
+ rr "github.com/spiral/roadrunner/cmd/rr/cmd"
// services (plugins)
"github.com/spiral/roadrunner/service/env"
@@ -38,8 +38,8 @@ import (
"github.com/spiral/roadrunner/service/static"
// additional commands and debug handlers
- _ "github.com/spiral/roadrunner/service/reload/cmd/rr/http"
- _ "github.com/spiral/roadrunner/service/reload/cmd/rr/limit"
+ _ "github.com/spiral/roadrunner/cmd/rr/http"
+ _ "github.com/spiral/roadrunner/cmd/rr/limit"
)
func main() {
diff --git a/service/reload/service.go b/service/reload/service.go
index 832ac185..a8e862cb 100644
--- a/service/reload/service.go
+++ b/service/reload/service.go
@@ -91,6 +91,9 @@ func (s *Service) Serve() error {
service string
}, 100)
+ // use the same interval
+ ticker := time.NewTicker(s.cfg.Interval)
+
// drain channel in case of leaved messages
defer func() {
go func() {
@@ -109,12 +112,11 @@ func (s *Service) Serve() error {
service string
}{serviceConfig: s.cfg.Services[e.service], service: e.service}
+ ticker.Stop()
+ ticker = time.NewTicker(s.cfg.Interval)
}
}()
- // use the same interval
- ticker := time.NewTicker(s.cfg.Interval)
-
// map with configs by services
updated := make(map[string]ServiceConfig, 100)