summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2018-07-23 17:21:40 +0100
committerErik Johnston <erik@matrix.org>2018-07-23 17:21:40 +0100
commit50c60e5fadbefff6785c17dda9eecf88286dba30 (patch)
tree98a9728d50defc0a28a4efbcb5b85e65562fe79b /synapse/storage
parentMerge pull request #3582 from matrix-org/erikj/fixup_stateless (diff)
downloadsynapse-50c60e5fadbefff6785c17dda9eecf88286dba30.tar.xz
Only get cached state from context in persist_event
We don't want to bother pulling out the current state from the DB since
until we know we have to. Checking the context for state is just an
optimisation.
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/events.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/synapse/storage/events.py b/synapse/storage/events.py
index bf4f3ee92a..dc0b3c2eba 100644
--- a/synapse/storage/events.py
+++ b/synapse/storage/events.py
@@ -549,7 +549,9 @@ class EventsStore(EventsWorkerStore):
             if ctx.state_group in state_groups_map:
                 continue
 
-            state_groups_map[ctx.state_group] = yield ctx.get_current_state_ids(self)
+            current_state_ids = ctx.get_cached_current_state_ids()
+            if current_state_ids is not None:
+                state_groups_map[ctx.state_group] = current_state_ids
 
         # We need to map the event_ids to their state groups. First, let's
         # check if the event is one we're persisting, in which case we can