decreasing wait time for updating px cache on startup (#3140)

This commit is contained in:
gabrielmer 2024-10-24 10:33:32 +03:00 committed by GitHub
parent 76606421a2
commit d098b93d9d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -219,11 +219,11 @@ proc populateEnrCache(wpx: WakuPeerExchange) =
proc updatePxEnrCache(wpx: WakuPeerExchange) {.async.} =
# try more aggressively to fill the cache at startup
var attempts = 10
var attempts = 50
while wpx.enrCache.len < MaxPeersCacheSize and attempts > 0:
attempts -= 1
wpx.populateEnrCache()
await sleepAsync(5.seconds)
await sleepAsync(1.seconds)
heartbeat "Updating px enr cache", CacheRefreshInterval:
wpx.populateEnrCache()