mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-07-29 12:42:46 +00:00
Ack tweaks
This commit is contained in:
parent
eb07c2d5d7
commit
134ec18614
9 changed files with 28 additions and 28 deletions
|
@ -74,7 +74,7 @@ func (s *OutputClientDataConsumer) onMessage(msg *nats.Msg) {
|
|||
// If the message was invalid, log it and move on to the next message in the stream
|
||||
log.WithError(err).Errorf("client API server output log: message parse failure")
|
||||
sentry.CaptureException(err)
|
||||
_ = msg.Nak()
|
||||
_ = msg.Ack()
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ func (s *OutputReceiptEventConsumer) onMessage(msg *nats.Msg) {
|
|||
// If the message was invalid, log it and move on to the next message in the stream
|
||||
log.WithError(err).Errorf("EDU server output log: message parse failure")
|
||||
sentry.CaptureException(err)
|
||||
_ = msg.Nak()
|
||||
_ = msg.Ack()
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -74,18 +74,18 @@ func (s *OutputSendToDeviceEventConsumer) onMessage(msg *nats.Msg) {
|
|||
// If the message was invalid, log it and move on to the next message in the stream
|
||||
log.WithError(err).Errorf("EDU server output log: message parse failure")
|
||||
sentry.CaptureException(err)
|
||||
_ = msg.Nak()
|
||||
_ = msg.Ack()
|
||||
return
|
||||
}
|
||||
|
||||
_, domain, err := gomatrixserverlib.SplitID('@', output.UserID)
|
||||
if err != nil {
|
||||
sentry.CaptureException(err)
|
||||
_ = msg.Nak()
|
||||
_ = msg.Ack()
|
||||
return
|
||||
}
|
||||
if domain != s.serverName {
|
||||
_ = msg.Nak()
|
||||
_ = msg.Ack()
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ func (s *OutputTypingEventConsumer) onMessage(msg *nats.Msg) {
|
|||
// If the message was invalid, log it and move on to the next message in the stream
|
||||
log.WithError(err).Errorf("EDU server output log: message parse failure")
|
||||
sentry.CaptureException(err)
|
||||
_ = msg.Nak()
|
||||
_ = msg.Ack()
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ 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
|
||||
}
|
||||
|
||||
|
@ -96,6 +96,7 @@ func (s *OutputRoomEventConsumer) onMessage(msg *nats.Msg) {
|
|||
// in the special case where the event redacts itself, just pass the message through because
|
||||
// we will never see the other part of the pair
|
||||
if event.Redacts() != event.EventID() {
|
||||
_ = msg.Ack()
|
||||
return
|
||||
}
|
||||
}
|
||||
|
@ -116,7 +117,7 @@ func (s *OutputRoomEventConsumer) onMessage(msg *nats.Msg) {
|
|||
log.WithField("type", output.Type).Debug(
|
||||
"roomserver output log: ignoring unknown output type",
|
||||
)
|
||||
_ = msg.Nak()
|
||||
_ = msg.Ack()
|
||||
}
|
||||
if err != nil {
|
||||
log.WithError(err).Error("roomserver output log: failed to process event")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue