Skip to content

Commit 4158849

Browse files
committed
clean sendPriorityQueue even if there is no non-priority msg
1 parent 362c94b commit 4158849

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libp2p/protocols/pubsub/pubsubpeer.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,10 +370,10 @@ proc clearSendPriorityQueue(p: PubSubPeer) =
370370

371371
proc sendNonPriorityTask(p: PubSubPeer) {.async.} =
372372
while true:
373-
let msg = await p.rpcmessagequeue.nonPriorityQueue.popFirst()
374373
while p.rpcmessagequeue.sendPriorityQueue.len > 0:
375374
await p.rpcmessagequeue.sendPriorityQueue[0]
376375
p.clearSendPriorityQueue()
376+
let msg = await p.rpcmessagequeue.nonPriorityQueue.popFirst()
377377
when defined(libp2p_expensive_metrics):
378378
libp2p_gossipsub_non_priority_queue_size.dec(labelValues = [$p.peerId])
379379
await p.sendMsg(msg)

0 commit comments

Comments
 (0)