Skip to content

Commit

Permalink
feature: 调整node discovery watch方法; issue: TencentBlueKing#115
Browse files Browse the repository at this point in the history
  • Loading branch information
zmberg committed Aug 13, 2019
1 parent 84136d6 commit a298738
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions bcs-common/pkg/discovery/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ func NewNodeController(hosts []string, eventHandler reflector.EventInterface) (N
//create listwatcher
listwatcher := &reflector.ListWatch{
ListFn: func() ([]meta.Object, error) {
return nodeclient.List(context.Background(), "/agent", nil)
return nodeclient.List(context.Background(), "agent", nil)
},
WatchFn: func() (watch.Interface, error) {
return nodeclient.Watch(context.Background(), "/agent", "", nil)
return nodeclient.Watch(context.Background(), "agent", "", nil)
},
}
cxt, stopfn := context.WithCancel(context.Background())
Expand Down
2 changes: 1 addition & 1 deletion bcs-common/pkg/storage/zookeeper/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ func (n *Node) selfLoop() {
n.config.PushEventFunc(watch.EventUpdated, n.selfpath, rawBytes)
}
//wait for next event
forceTick := time.NewTicker(time.Second * 45)
forceTick := time.NewTicker(time.Second * 300)
for {
select {
case <-n.watchCxt.Done():
Expand Down

0 comments on commit a298738

Please sign in to comment.