mirror of
https://github.com/docker/docs.git
synced 2026-10-31 10:34:26 +03:00
@@ -65,7 +65,9 @@ func (s *ConsulDiscoveryService) Fetch() ([]*discovery.Node, error) {
|
||||
}
|
||||
|
||||
func (s *ConsulDiscoveryService) Watch(callback discovery.WatchCallback) {
|
||||
for _ = range time.Tick(time.Duration(s.heartbeat) * time.Second) {
|
||||
c := time.Tick(time.Duration(s.heartbeat) * time.Second)
|
||||
for {
|
||||
<-c
|
||||
nodes, err := s.Fetch()
|
||||
if err == nil {
|
||||
callback(nodes)
|
||||
|
||||
Reference in New Issue
Block a user