Merge pull request #316 from vdemeester/docker-provider-stop-support

Support stop chan on docker provider
This commit is contained in:
Emile Vauge 2016-04-16 17:20:55 +02:00
commit 23d3c512c2

View file

@ -130,6 +130,15 @@ func (provider *Docker) Provide(configurationChan chan<- types.ConfigMessage, po
eventHandler.Handle("die", startStopHandle) eventHandler.Handle("die", startStopHandle)
errChan := events.MonitorWithHandler(ctx, dockerClient, options, eventHandler) errChan := events.MonitorWithHandler(ctx, dockerClient, options, eventHandler)
pool.Go(func(stop chan bool) {
for {
select {
case <-stop:
cancel()
return
}
}
})
if err := <-errChan; err != nil { if err := <-errChan; err != nil {
return err return err
} }