Avoid goroutine leak in server

This commit is contained in:
NicoMen 2018-09-06 14:24:03 +02:00 committed by Traefiker Bot
parent e4bb506ace
commit 74ace58ae1
4 changed files with 23 additions and 15 deletions

View file

@ -447,8 +447,10 @@ func (s *Server) throttleProviderConfigReload(throttle time.Duration, publish ch
case <-stop:
return
case nextConfig := <-ring.Out():
publish <- nextConfig.(types.ConfigMessage)
time.Sleep(throttle)
if config, ok := nextConfig.(types.ConfigMessage); ok {
publish <- config
time.Sleep(throttle)
}
}
}
})