Add GoSafe goroutine launch
Signed-off-by: Emile Vauge <emile@vauge.com>
This commit is contained in:
parent
af41c79798
commit
bcc5f24c0f
10 changed files with 68 additions and 22 deletions
|
@ -12,6 +12,7 @@ import (
|
|||
|
||||
"github.com/BurntSushi/ty/fun"
|
||||
log "github.com/Sirupsen/logrus"
|
||||
"github.com/containous/traefik/safe"
|
||||
"github.com/containous/traefik/types"
|
||||
"github.com/docker/libkv"
|
||||
"github.com/docker/libkv/store"
|
||||
|
@ -101,7 +102,9 @@ func (provider *Kv) provide(configurationChan chan<- types.ConfigMessage) error
|
|||
}
|
||||
provider.kvclient = kv
|
||||
if provider.Watch {
|
||||
go provider.watchKv(configurationChan, provider.Prefix)
|
||||
safe.Go(func() {
|
||||
provider.watchKv(configurationChan, provider.Prefix)
|
||||
})
|
||||
}
|
||||
configuration := provider.loadConfig()
|
||||
configurationChan <- types.ConfigMessage{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue