Skip to content

Commit

Permalink
make sure we don't block sending this ack
Browse files Browse the repository at this point in the history
  • Loading branch information
reillyse committed Jan 23, 2025
1 parent 5a051bd commit 21770f8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions internal/msgqueue/rabbitmq/rabbitmq.go
Original file line number Diff line number Diff line change
Expand Up @@ -452,10 +452,13 @@ func (t *MessageQueueImpl) startPublishing() func() error {

err = pub.PublishWithContext(ctx, "", msg.q.Name(), false, false, pubMsg)

// retry failed delivery on the next session
if err != nil {
msg.ackChan <- ack{e: &err}
t.msgs <- msg
select {
case msg.ackChan <- ack{e: &err}:
t.msgs <- msg
case <-time.After(100 * time.Millisecond):
t.l.Error().Msgf("ack channel blocked for %s", msg.ID)
}
return
}

Expand Down

0 comments on commit 21770f8

Please sign in to comment.