summary refs log tree commit diff
path: root/synapse/handlers/sync.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-02-03 15:20:00 +0000
committerErik Johnston <erik@matrix.org>2016-02-03 15:20:00 +0000
commitc8e4d5de7f03a6b3dc7b2dfe2ad6fade008b8557 (patch)
treedc4409923eab9b949bed5da7c3056efa153f3c40 /synapse/handlers/sync.py
parentMerge pull request #554 from matrix-org/erikj/event_push (diff)
parentAllowing tagging log contexts (diff)
downloadsynapse-c8e4d5de7f03a6b3dc7b2dfe2ad6fade008b8557.tar.xz
Merge pull request #555 from matrix-org/erikj/logcontext
Allowing tagging log contexts
Diffstat (limited to 'synapse/handlers/sync.py')
-rw-r--r--synapse/handlers/sync.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/synapse/handlers/sync.py b/synapse/handlers/sync.py

index 0292e06733..72271f2626 100644 --- a/synapse/handlers/sync.py +++ b/synapse/handlers/sync.py
@@ -18,6 +18,7 @@ from ._base import BaseHandler from synapse.streams.config import PaginationConfig from synapse.api.constants import Membership, EventTypes from synapse.util import unwrapFirstError +from synapse.util.logcontext import LoggingContext from twisted.internet import defer @@ -140,6 +141,15 @@ class SyncHandler(BaseHandler): A Deferred SyncResult. """ + context = LoggingContext.current_context() + if context: + if since_token is None: + context.tag = "initial_sync" + elif full_state: + context.tag = "full_state_sync" + else: + context.tag = "incremental_sync" + if timeout == 0 or since_token is None or full_state: # we are going to return immediately, so don't bother calling # notifier.wait_for_events.