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

Fixes some warnings, and a scary-looking stacktrace when sytest kills the
process.
pull/14/head
Richard van der Hoff 6 years ago committed by GitHub
parent 89d3d7b2c0
commit 71063a69b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      changelog.d/5369.bugfix
  2. 8
      synapse/handlers/presence.py

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

@ -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

Loading…
Cancel
Save