Skip to content

Commit

Permalink
Ack when AutoAckDisabled is off
Browse files Browse the repository at this point in the history
Signed-off-by: shivam <shivamkm07@gmail.com>
  • Loading branch information
shivamkm07 committed Oct 18, 2022
1 parent 35f45ad commit 2518954
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions router.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ func (r *router) matchAndDispatch(messages <-chan *packets.PublishPacket, order
wg.Add(1)
go func() {
hd(client, m)
if client.options.AutoAckDisabled {
if !client.options.AutoAckDisabled {
m.Ack()
}
wg.Done()
Expand All @@ -203,7 +203,7 @@ func (r *router) matchAndDispatch(messages <-chan *packets.PublishPacket, order
wg.Add(1)
go func() {
r.defaultHandler(client, m)
if client.options.AutoAckDisabled {
if !client.options.AutoAckDisabled {
m.Ack()
}
wg.Done()
Expand All @@ -216,7 +216,7 @@ func (r *router) matchAndDispatch(messages <-chan *packets.PublishPacket, order
r.RUnlock()
for _, handler := range handlers {
handler(client, m)
if client.options.AutoAckDisabled {
if !client.options.AutoAckDisabled {
m.Ack()
}
}
Expand Down

0 comments on commit 2518954

Please sign in to comment.