mirror of
https://github.com/logos-storage/logos-storage-nim.git
synced 2026-03-16 17:23:06 +00:00
Disable advertiseQueueLoop completely
It's the main CPU/memory eater
This commit is contained in:
parent
84536744d4
commit
7d6330b938
@ -76,11 +76,9 @@ proc discoveryQueueLoop(b: DiscoveryEngine) {.async.} =
|
||||
await sleepAsync(b.discoveryLoopSleep)
|
||||
|
||||
proc advertiseQueueLoop*(b: DiscoveryEngine) {.async.} =
|
||||
var x=0
|
||||
proc onBlock(cid: Cid) {.async.} =
|
||||
try:
|
||||
#await b.advertiseQueue.put(cid)
|
||||
x = x+1
|
||||
await b.advertiseQueue.put(cid)
|
||||
except CancelledError as exc:
|
||||
trace "Cancelling block listing"
|
||||
raise exc
|
||||
@ -88,8 +86,7 @@ proc advertiseQueueLoop*(b: DiscoveryEngine) {.async.} =
|
||||
trace "Exception listing blocks", exc = exc.msg
|
||||
|
||||
while b.discEngineRunning:
|
||||
discard await b.localStore.listBlocks(onBlock)
|
||||
if x==42: echo x
|
||||
#discard await b.localStore.listBlocks(onBlock)
|
||||
|
||||
trace "About to sleep advertise loop", sleep = b.advertiseLoopSleep
|
||||
await sleepAsync(b.advertiseLoopSleep)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user