diff options
author | Erik Johnston <erik@matrix.org> | 2016-08-23 15:23:39 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2016-08-24 11:58:40 +0100 |
commit | 921913935176f5bd3df5e5b960d87c94a2adb304 (patch) | |
tree | ccb7c2bddbad96b35fcb0de89b562ed0a4115a67 /synapse/handlers/typing.py | |
parent | Merge pull request #1039 from matrix-org/kegan/join-with-custom-content (diff) | |
download | synapse-921913935176f5bd3df5e5b960d87c94a2adb304.tar.xz |
Preserve some logcontexts
Diffstat (limited to 'synapse/handlers/typing.py')
-rw-r--r-- | synapse/handlers/typing.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/synapse/handlers/typing.py b/synapse/handlers/typing.py index 5589296c09..46181984c0 100644 --- a/synapse/handlers/typing.py +++ b/synapse/handlers/typing.py @@ -16,7 +16,9 @@ from twisted.internet import defer from synapse.api.errors import SynapseError, AuthError -from synapse.util.logcontext import PreserveLoggingContext +from synapse.util.logcontext import ( + PreserveLoggingContext, preserve_fn, preserve_context_over_deferred, +) from synapse.util.metrics import Measure from synapse.types import UserID @@ -169,13 +171,13 @@ class TypingHandler(object): deferreds = [] for domain in domains: if domain == self.server_name: - self._push_update_local( + preserve_fn(self._push_update_local)( room_id=room_id, user_id=user_id, typing=typing ) else: - deferreds.append(self.federation.send_edu( + deferreds.append(preserve_fn(self.federation.send_edu)( destination=domain, edu_type="m.typing", content={ @@ -185,7 +187,9 @@ class TypingHandler(object): }, )) - yield defer.DeferredList(deferreds, consumeErrors=True) + yield preserve_context_over_deferred( + defer.DeferredList(deferreds, consumeErrors=True) + ) @defer.inlineCallbacks def _recv_edu(self, origin, content): |