Support stop chan on docker provider
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
parent
f2320ee648
commit
4144638be4
1 changed files with 9 additions and 0 deletions
|
@ -130,6 +130,15 @@ func (provider *Docker) Provide(configurationChan chan<- types.ConfigMessage, po
|
|||
eventHandler.Handle("die", startStopHandle)
|
||||
|
||||
errChan := events.MonitorWithHandler(ctx, dockerClient, options, eventHandler)
|
||||
pool.Go(func(stop chan bool) {
|
||||
for {
|
||||
select {
|
||||
case <-stop:
|
||||
cancel()
|
||||
return
|
||||
}
|
||||
}
|
||||
})
|
||||
if err := <-errChan; err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue