Simplification

This commit is contained in:
ferhat elmas 2017-12-06 10:52:03 +01:00 committed by Traefiker
parent e2190bd9d5
commit 6890dc1844
3 changed files with 6 additions and 15 deletions

View file

@ -190,13 +190,8 @@ func (p *Provider) Provide(configurationChan chan<- types.ConfigMessage, pool *s
} else { } else {
pool.Go(func(stop chan bool) { pool.Go(func(stop chan bool) {
for { <-stop
select { cancel()
case <-stop:
cancel()
return
}
}
}) })
f := filters.NewArgs() f := filters.NewArgs()
f.Add("type", "container") f.Add("type", "container")

View file

@ -155,10 +155,8 @@ func (p *Provider) Provide(configurationChan chan<- types.ConfigMessage, pool *s
pool.Go(func(stop chan bool) { pool.Go(func(stop chan bool) {
ctx, cancel := context.WithCancel(context.Background()) ctx, cancel := context.WithCancel(context.Background())
safe.Go(func() { safe.Go(func() {
select { <-stop
case <-stop: cancel()
cancel()
}
}) })
operation := func() error { operation := func() error {

View file

@ -114,10 +114,8 @@ func (p *Provider) Provide(configurationChan chan<- types.ConfigMessage, pool *s
pool.Go(func(stop chan bool) { pool.Go(func(stop chan bool) {
ctx, cancel := context.WithCancel(context.Background()) ctx, cancel := context.WithCancel(context.Background())
safe.Go(func() { safe.Go(func() {
select { <-stop
case <-stop: cancel()
cancel()
}
}) })
operation := func() error { operation := func() error {