Skip to content

Commit

Permalink
fix protect mode
Browse files Browse the repository at this point in the history
  • Loading branch information
lintanghui committed Jul 10, 2019
1 parent 895e035 commit 39a5057
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion discovery/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func New(c *conf.Config) (d *Discovery, cancel context.CancelFunc) {
}

func (d *Discovery) exitProtect() {
time.Sleep(time.Second * 90)
// exist protect mode after two renew cycle
time.Sleep(time.Second * 60)
d.protected = false
}
2 changes: 2 additions & 0 deletions discovery/syncup.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ func (d *Discovery) syncUp() {
log.Error("service syncup from(%s) failed ", uri)
continue
}
// sync success from other node,exit protected mode
d.protected = false
for _, is := range res.Data {
for _, i := range is {
_ = d.registry.Register(i, i.LatestTimestamp)
Expand Down

0 comments on commit 39a5057

Please sign in to comment.