完善队列集合的ACK确认机制

This commit is contained in:
fantasticbin 2024-12-10 16:50:34 +08:00
parent f290e7dd0c
commit 49f4d119ec

View File

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