mirror of
https://github.com/netbirdio/netbird.git
synced 2025-06-04 00:55:58 +02:00
Reduce max wait time to initialize peer connections (#2984)
* Reduce max wait time to initialize peer connections setting rand time range to 100-300ms instead of 100-800ms * remove min wait time
This commit is contained in:
parent
6cfbb1f320
commit
e67fe89adb
@ -597,9 +597,8 @@ func (conn *Conn) doOnConnected(remoteRosenpassPubKey []byte, remoteRosenpassAdd
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (conn *Conn) waitInitialRandomSleepTime(ctx context.Context) {
|
func (conn *Conn) waitInitialRandomSleepTime(ctx context.Context) {
|
||||||
minWait := 100
|
maxWait := 300
|
||||||
maxWait := 800
|
duration := time.Duration(rand.Intn(maxWait)) * time.Millisecond
|
||||||
duration := time.Duration(rand.Intn(maxWait-minWait)+minWait) * time.Millisecond
|
|
||||||
|
|
||||||
timeout := time.NewTimer(duration)
|
timeout := time.NewTimer(duration)
|
||||||
defer timeout.Stop()
|
defer timeout.Stop()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user