Skip to content
This repository has been archived by the owner on Nov 25, 2024. It is now read-only.

Commit

Permalink
Don't log the same error twice, undo unrelated change
Browse files Browse the repository at this point in the history
  • Loading branch information
S7evinK committed Dec 1, 2023
1 parent d216eea commit 0992337
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion appservice/consumers/roomserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func (s *OutputRoomEventConsumer) onMessage(
for _, msg := range msgs {
// Only handle events we care about
receivedType := api.OutputType(msg.Header.Get(jetstream.RoomEventType))
if receivedType != api.OutputTypeNewRoomEvent {
if receivedType != api.OutputTypeNewRoomEvent && receivedType != api.OutputTypeNewInviteEvent {
continue
}
// Parse out the event JSON
Expand Down
8 changes: 2 additions & 6 deletions syncapi/producers/appservices.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ package producers

import (
"github.com/nats-io/nats.go"
"github.com/sirupsen/logrus"
)

// AppserviceEventProducer produces events for the appservice API to consume
Expand All @@ -29,9 +28,6 @@ func (a *AppserviceEventProducer) ProduceRoomEvents(
msg *nats.Msg,
) error {
msg.Subject = a.Topic
if _, err := a.JetStream.PublishMsg(msg); err != nil {
logrus.WithError(err).Errorf("Failed to produce to topic '%s': %s", a.Topic, err)
return err
}
return nil
_, err := a.JetStream.PublishMsg(msg)
return err
}

0 comments on commit 0992337

Please sign in to comment.