mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-16 18:43:10 -06:00
Set InactiveThreshold on roomserver durable consumers
This commit is contained in:
parent
f76969831e
commit
930d3a4b7f
|
|
@ -130,6 +130,13 @@ func (r *Inputer) startWorkerForRoom(roomID string) {
|
||||||
DeliverPolicy: nats.DeliverAllPolicy,
|
DeliverPolicy: nats.DeliverAllPolicy,
|
||||||
FilterSubject: subject,
|
FilterSubject: subject,
|
||||||
AckWait: MaximumMissingProcessingTime + (time.Second * 10),
|
AckWait: MaximumMissingProcessingTime + (time.Second * 10),
|
||||||
|
|
||||||
|
// If the consumer is inactive for a while then we will allow NATS
|
||||||
|
// to clean it up. This prevents us from holding onto durable
|
||||||
|
// consumers indefinitely for rooms that might no longer be active,
|
||||||
|
// since they do have a small overhead. If the room becomes active
|
||||||
|
// again then we'll recreate the consumer anyway.
|
||||||
|
InactiveThreshold: time.Hour,
|
||||||
},
|
},
|
||||||
); err != nil {
|
); err != nil {
|
||||||
logrus.WithError(err).Errorf("Failed to create consumer for room %q", w.roomID)
|
logrus.WithError(err).Errorf("Failed to create consumer for room %q", w.roomID)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue