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

Commit

Permalink
Fix missing logcontext for PresenceHandler.on_shutdown. (#5369)
Browse files Browse the repository at this point in the history
Fixes some warnings, and a scary-looking stacktrace when sytest kills the
process.
  • Loading branch information
richvdh authored Jun 6, 2019
1 parent 89d3d7b commit 71063a6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/5369.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix missing logcontext warnings on shutdown.
8 changes: 7 additions & 1 deletion synapse/handlers/presence.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,13 @@ def __init__(self, hs):
# have not yet been persisted
self.unpersisted_users_changes = set()

hs.get_reactor().addSystemEventTrigger("before", "shutdown", self._on_shutdown)
hs.get_reactor().addSystemEventTrigger(
"before",
"shutdown",
run_as_background_process,
"presence.on_shutdown",
self._on_shutdown,
)

self.serial_to_user = {}
self._next_serial = 1
Expand Down

0 comments on commit 71063a6

Please sign in to comment.