Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 71063a6

Browse files
authored
Fix missing logcontext for PresenceHandler.on_shutdown. (#5369)
Fixes some warnings, and a scary-looking stacktrace when sytest kills the process.
1 parent 89d3d7b commit 71063a6

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

changelog.d/5369.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix missing logcontext warnings on shutdown.

synapse/handlers/presence.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,13 @@ def __init__(self, hs):
158158
# have not yet been persisted
159159
self.unpersisted_users_changes = set()
160160

161-
hs.get_reactor().addSystemEventTrigger("before", "shutdown", self._on_shutdown)
161+
hs.get_reactor().addSystemEventTrigger(
162+
"before",
163+
"shutdown",
164+
run_as_background_process,
165+
"presence.on_shutdown",
166+
self._on_shutdown,
167+
)
162168

163169
self.serial_to_user = {}
164170
self._next_serial = 1

0 commit comments

Comments
 (0)