Skip to content

Commit

Permalink
peer_manager: prevent too intense loop when no peers connected (#3130)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivansete-status authored Oct 22, 2024
1 parent 889067b commit 3dc3fc8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion waku/node/peer_manager/peer_manager.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 3dc3fc8

Please sign in to comment.