mirror of
https://github.com/matrix-org/dendrite
synced 2024-12-25 19:13:50 +01:00
Detect consumer being deleted in JetStreamConsumer
This commit is contained in:
parent
1e714bc3b6
commit
a916b041b1
1 changed files with 4 additions and 0 deletions
|
@ -2,6 +2,7 @@ package jetstream
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/getsentry/sentry-go"
|
"github.com/getsentry/sentry-go"
|
||||||
|
@ -72,6 +73,9 @@ func JetStreamConsumer(
|
||||||
// just timed out and we should try again.
|
// just timed out and we should try again.
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
} else if errors.Is(err, nats.ErrConsumerDeleted) {
|
||||||
|
// The consumer was deleted so stop.
|
||||||
|
return
|
||||||
} else {
|
} else {
|
||||||
// Something else went wrong, so we'll panic.
|
// Something else went wrong, so we'll panic.
|
||||||
sentry.CaptureException(err)
|
sentry.CaptureException(err)
|
||||||
|
|
Loading…
Reference in a new issue