Is Watching?
This commit is contained in:
parent
be179e6b68
commit
f5ea23ed2b
2 changed files with 25 additions and 23 deletions
|
@ -48,7 +48,6 @@ func (provider *DockerProvider) Provide(configurationChan chan <- *Configuration
|
|||
dockerEvents := make(chan *docker.APIEvents)
|
||||
if (provider.Watch) {
|
||||
provider.dockerClient.AddEventListener(dockerEvents)
|
||||
}
|
||||
go func() {
|
||||
for {
|
||||
event := <-dockerEvents
|
||||
|
@ -59,6 +58,7 @@ func (provider *DockerProvider) Provide(configurationChan chan <- *Configuration
|
|||
}
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
configuration := provider.loadDockerConfig()
|
||||
configurationChan <- configuration
|
||||
|
|
|
@ -47,6 +47,7 @@ func (provider *MarathonProvider) Provide(configurationChan chan <- *Configurati
|
|||
} else {
|
||||
provider.marathonClient = client
|
||||
update := make(marathon.EventsChannel, 5)
|
||||
if (provider.Watch) {
|
||||
if err := client.AddEventsListener(update, marathon.EVENTS_APPLICATIONS); err != nil {
|
||||
log.Println("Failed to register for subscriptions, %s", err)
|
||||
} else {
|
||||
|
@ -61,6 +62,7 @@ func (provider *MarathonProvider) Provide(configurationChan chan <- *Configurati
|
|||
}
|
||||
}()
|
||||
}
|
||||
}
|
||||
|
||||
configuration := provider.loadMarathonConfig()
|
||||
configurationChan <- configuration
|
||||
|
|
Loading…
Reference in a new issue