Skip to content

Commit

Permalink
Ignore calls to Ack/Nack if the doneFunc isn't set (#3139)
Browse files Browse the repository at this point in the history
This allows for simple testing.

I personally prefer #2920, but I didn't win that.

Co-authored-by: Alex Hong <9397363+hongalex@users.noreply.github.com>
  • Loading branch information
Jille and hongalex committed Nov 6, 2020
1 parent 472b731 commit 8c135e0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pubsub/message.go
Expand Up @@ -119,5 +119,7 @@ func (m *Message) done(ack bool) {
return
}
m.calledDone = true
m.doneFunc(m.ackID, ack, m.receiveTime)
if m.doneFunc != nil {
m.doneFunc(m.ackID, ack, m.receiveTime)
}
}

0 comments on commit 8c135e0

Please sign in to comment.