mirror of
https://github.com/matrix-org/dendrite
synced 2024-12-15 07:03:44 +01:00
Add missing error check
Keep typing events for at least one minute
This commit is contained in:
parent
c0c0b03c52
commit
f7cfa24027
1 changed files with 5 additions and 2 deletions
|
@ -91,9 +91,9 @@ func setupNATS(cfg *config.Kafka) (sarama.Consumer, sarama.SyncProducer) {
|
|||
|
||||
// Typing events can be removed from the stream, as they are only relevant for a short time
|
||||
if topic == config.TopicOutputTypingEvent {
|
||||
maxLifeTime = time.Second * 30
|
||||
maxLifeTime = time.Second * 60
|
||||
}
|
||||
_, _ = s.AddStream(&nats.StreamConfig{
|
||||
_, err = s.AddStream(&nats.StreamConfig{
|
||||
Name: sn,
|
||||
Subjects: []string{topic},
|
||||
MaxBytes: int64(*cfg.MaxMessageBytes),
|
||||
|
@ -101,6 +101,9 @@ func setupNATS(cfg *config.Kafka) (sarama.Consumer, sarama.SyncProducer) {
|
|||
MaxAge: maxLifeTime,
|
||||
Duplicates: maxLifeTime / 2,
|
||||
})
|
||||
if err != nil {
|
||||
logrus.WithError(err).WithField("stream", sn).Fatal("unable to add nats stream")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue