diff options
author | Richard van der Hoff <1389908+richvdh@users.noreply.github.com> | 2018-04-30 00:34:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-30 00:34:28 +0100 |
commit | aab2e4da60a11de3d84e9a603077cc43386db1f4 (patch) | |
tree | f3b6b59408b7ca4cd16925ff7f1f50785032872b /synapse/handlers/message.py | |
parent | Merge pull request #3156 from NotAFile/py3-hmac-bytes (diff) | |
parent | pep8; remove spurious import (diff) | |
download | synapse-aab2e4da60a11de3d84e9a603077cc43386db1f4.tar.xz |
Merge pull request #3140 from matrix-org/rav/use_run_in_background
Use run_in_background in preference to preserve_fn
Diffstat (limited to 'synapse/handlers/message.py')
-rw-r--r-- | synapse/handlers/message.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py index ad932bdd90..23502eda70 100644 --- a/synapse/handlers/message.py +++ b/synapse/handlers/message.py @@ -31,7 +31,7 @@ from synapse.types import ( UserID, RoomAlias, RoomStreamToken, ) from synapse.util.async import run_on_reactor, ReadWriteLock, Limiter -from synapse.util.logcontext import preserve_fn, run_in_background +from synapse.util.logcontext import run_in_background from synapse.util.metrics import measure_func from synapse.util.frozenutils import frozendict_json_encoder from synapse.util.stringutils import random_string @@ -857,7 +857,8 @@ class EventCreationHandler(object): # this intentionally does not yield: we don't care about the result # and don't need to wait for it. - preserve_fn(self.pusher_pool.on_new_notifications)( + run_in_background( + self.pusher_pool.on_new_notifications, event_stream_id, max_stream_id ) @@ -872,7 +873,7 @@ class EventCreationHandler(object): except Exception: logger.exception("Error notifying about new room event") - preserve_fn(_notify)() + run_in_background(_notify) if event.type == EventTypes.Message: # We don't want to block sending messages on any presence code. This |