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

Fixes some warnings, and a scary-looking stacktrace when sytest kills the
process.
pull/5380/head
Richard van der Hoff 2019-06-06 14:45:17 +01:00 committed by GitHub
parent 89d3d7b2c0
commit 71063a69b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

1
changelog.d/5369.bugfix Normal file
View File

@ -0,0 +1 @@
Fix missing logcontext warnings on shutdown.

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