mirror of https://github.com/waku-org/nwaku.git
peer_manager: prevent too intense loop when no peers connected (#3130)
This commit is contained in:
parent
889067ba20
commit
3dc3fc8e5a
|
@ -928,7 +928,7 @@ proc relayConnectivityLoop*(pm: PeerManager) {.async.} =
|
|||
chronos.seconds(int(float(ConnectivityLoopInterval.seconds()) * factor))
|
||||
|
||||
# Shorten the connectivity loop interval dynamically based on percentage of peers to fill or connections to prune
|
||||
await sleepAsync(dynamicSleepInterval)
|
||||
await sleepAsync(max(dynamicSleepInterval, chronos.seconds(1)))
|
||||
|
||||
proc pruneInRelayConns(pm: PeerManager, amount: int) {.async.} =
|
||||
if amount <= 0:
|
||||
|
|
Loading…
Reference in New Issue