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)) }