Don't log the same error twice, undo unrelated change

This commit is contained in:
Till Faelligen 2023-12-01 12:24:12 +01:00
parent d216eea879
commit 099233770b
No known key found for this signature in database
GPG key ID: ACCDC9606D472758
2 changed files with 3 additions and 7 deletions

View file

@ -119,7 +119,7 @@ func (s *OutputRoomEventConsumer) onMessage(
for _, msg := range msgs { for _, msg := range msgs {
// Only handle events we care about // Only handle events we care about
receivedType := api.OutputType(msg.Header.Get(jetstream.RoomEventType)) receivedType := api.OutputType(msg.Header.Get(jetstream.RoomEventType))
if receivedType != api.OutputTypeNewRoomEvent { if receivedType != api.OutputTypeNewRoomEvent && receivedType != api.OutputTypeNewInviteEvent {
continue continue
} }
// Parse out the event JSON // Parse out the event JSON

View file

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