0
0
Fork 0
mirror of https://github.com/matrix-org/dendrite synced 2024-06-13 09:58:59 +02:00

Don't attempt to send transactions if Dendrite is shutting down

This commit is contained in:
Till Faelligen 2024-04-08 20:38:50 +02:00
parent 8aa088f713
commit 1f723362c0
No known key found for this signature in database
GPG key ID: 3DF82D8AB9211D4E

View file

@ -294,6 +294,10 @@ func (oq *destinationQueue) checkNotificationsOnClose() {
// backgroundSend is the worker goroutine for sending events.
func (oq *destinationQueue) backgroundSend() {
// Don't try to send transactions if we are shutting down.
if oq.process.Context() != nil {
return
}
// Check if a worker is already running, and if it isn't, then
// mark it as started.
if !oq.running.CompareAndSwap(false, true) {