mirror of https://github.com/waku-org/nwaku.git
decreasing wait time for updating px cache on startup (#3140)
This commit is contained in:
parent
76606421a2
commit
d098b93d9d
|
@ -219,11 +219,11 @@ proc populateEnrCache(wpx: WakuPeerExchange) =
|
||||||
|
|
||||||
proc updatePxEnrCache(wpx: WakuPeerExchange) {.async.} =
|
proc updatePxEnrCache(wpx: WakuPeerExchange) {.async.} =
|
||||||
# try more aggressively to fill the cache at startup
|
# try more aggressively to fill the cache at startup
|
||||||
var attempts = 10
|
var attempts = 50
|
||||||
while wpx.enrCache.len < MaxPeersCacheSize and attempts > 0:
|
while wpx.enrCache.len < MaxPeersCacheSize and attempts > 0:
|
||||||
attempts -= 1
|
attempts -= 1
|
||||||
wpx.populateEnrCache()
|
wpx.populateEnrCache()
|
||||||
await sleepAsync(5.seconds)
|
await sleepAsync(1.seconds)
|
||||||
|
|
||||||
heartbeat "Updating px enr cache", CacheRefreshInterval:
|
heartbeat "Updating px enr cache", CacheRefreshInterval:
|
||||||
wpx.populateEnrCache()
|
wpx.populateEnrCache()
|
||||||
|
|
Loading…
Reference in New Issue