forked from TrueCloudLab/neoneo-go
network: sleep a bit before retrying reconnects
If Dial() is to exit quickly we can end up in a retry loop eating CPU.
This commit is contained in:
parent
a17d9f80a4
commit
af24051bf5
1 changed files with 1 additions and 0 deletions
|
@ -261,6 +261,7 @@ func (d *DefaultDiscovery) tryAddress(addr string) {
|
||||||
d.lock.Unlock()
|
d.lock.Unlock()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
d.RegisterBadAddr(addr)
|
d.RegisterBadAddr(addr)
|
||||||
|
time.Sleep(d.dialTimeout)
|
||||||
d.RequestRemote(1)
|
d.RequestRemote(1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue