Skip to content

Commit

Permalink
commit
Browse files Browse the repository at this point in the history
  • Loading branch information
binbin0325 committed Oct 3, 2020
1 parent 96f93fb commit 9b9613c
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions clients/config_client/config_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ const (

var (
currentTaskCount int
cacheMap cache.ConcurrentMap
schedulerMap cache.ConcurrentMap
cacheMap = cache.NewConcurrentMap()
schedulerMap = cache.NewConcurrentMap()
)

type cacheData struct {
Expand All @@ -75,6 +75,11 @@ type cacheDataListener struct {
lastMd5 string
}

func init() {
schedulerMap.Set("root", true)
go delayScheduler(time.NewTimer(1*time.Millisecond), 10*time.Millisecond, "root", listenConfigExecutor())
}

func NewConfigClient(nc nacos_client.INacosClient) (ConfigClient, error) {
config := ConfigClient{}
config.INacosClient = nc
Expand Down Expand Up @@ -108,10 +113,6 @@ func NewConfigClient(nc nacos_client.INacosClient) (ConfigClient, error) {
}
config.kmsClient = kmsClient
}
cacheMap = cache.NewConcurrentMap()
schedulerMap = cache.NewConcurrentMap()
schedulerMap.Set("root", true)
go delayScheduler(time.NewTimer(1*time.Millisecond), 10*time.Millisecond, "root", listenConfigExecutor())
return config, err
}

Expand Down

0 comments on commit 9b9613c

Please sign in to comment.