diff options
Diffstat (limited to 'service/reload/service.go')
-rw-r--r-- | service/reload/service.go | 8 |
1 files changed, 5 insertions, 3 deletions
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) |