From 49f4d119ec8c5657e10cbf2c1de6ae88092ca56f Mon Sep 17 00:00:00 2001 From: fantasticbin Date: Tue, 10 Dec 2024 16:50:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E9=98=9F=E5=88=97=E9=9B=86?= =?UTF-8?q?=E5=90=88=E7=9A=84ACK=E7=A1=AE=E8=AE=A4=E6=9C=BA=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lock_free/queues.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lock_free/queues.go b/lock_free/queues.go index 5a2d5f9..d238b1b 100644 --- a/lock_free/queues.go +++ b/lock_free/queues.go @@ -35,7 +35,7 @@ func (q *Queues[TKey, TValue, TRoute]) SetExpireAutoFail(expireAutoFail time.Dur func (q *Queues[TKey, TValue, TRoute]) checkAckStatus(route TRoute) { if ack, ok := q.ack.Load(route); ok && !q.autoAck { if status, exist := <-ack.(chan bool); !status && exist { - if msg, ok := q.msgs.Load(route); ok { + if msg, ok := q.msgs.LoadAndDelete(route); ok { // 重新入队 q.Enqueue(route, msg.(TValue)) }