From ee15f84a9b545ba99c8d678f14367e216e9980f2 Mon Sep 17 00:00:00 2001 From: Valery Piashchynski Date: Sun, 23 Feb 2020 15:31:45 +0300 Subject: Fix broken imports --- service/reload/service.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'service/reload') 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) -- cgit v1.2.3