Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

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

Merged
merged 2 commits into from
Apr 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions federationapi/queue/destinationqueue.go
Original file line number Diff line number Diff line change
Expand Up @@ -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().Err() != 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) {
Expand Down
Loading