Fix missing logcontext for PresenceHandler.on_shutdown. (#5369)

Fixes some warnings, and a scary-looking stacktrace when sytest kills the
process.
This commit is contained in:
Richard van der Hoff
2019-06-06 14:45:17 +01:00
committed by GitHub
parent 89d3d7b2c0
commit 71063a69b8
2 changed files with 8 additions and 1 deletions
+1
View File
@@ -0,0 +1 @@
Fix missing logcontext warnings on shutdown.
+7 -1
View File
@@ -158,7 +158,13 @@ class PresenceHandler(object):
# 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