Ack tweaks

This commit is contained in:
Neil Alexander 2021-11-03 15:57:36 +00:00
parent eb07c2d5d7
commit 134ec18614
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
9 changed files with 28 additions and 28 deletions

View file

@ -74,12 +74,12 @@ func (s *OutputRoomEventConsumer) onMessage(msg *nats.Msg) {
if err := json.Unmarshal(msg.Data, &output); err != nil {
// If the message was invalid, log it and move on to the next message in the stream
log.WithError(err).Errorf("roomserver output log: message parse failure")
_ = msg.Nak()
_ = msg.Ack()
return
}
if output.Type != api.OutputTypeNewRoomEvent {
_ = msg.Nak()
_ = msg.Ack()
return
}
@ -89,7 +89,6 @@ func (s *OutputRoomEventConsumer) onMessage(msg *nats.Msg) {
// Send event to any relevant application services
if err := s.filterRoomserverEvents(context.TODO(), events); err != nil {
log.WithError(err).Errorf("roomserver output log: filter error")
_ = msg.Nak()
return
}