summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2018-07-23 17:52:45 +0100
committerGitHub <noreply@github.com>2018-07-23 17:52:45 +0100
commitf559119de0009cfa1d396358eb8c788ccc9da53b (patch)
tree0ee4c637318472f350e0f951ecac96ff1646b108 /synapse/storage
parentMerge pull request #3582 from matrix-org/erikj/fixup_stateless (diff)
parentComments (diff)
downloadsynapse-f559119de0009cfa1d396358eb8c788ccc9da53b.tar.xz
Merge pull request #3584 from matrix-org/erikj/use_cached
Only get cached state from context in persist_event
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/events.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/synapse/storage/events.py b/synapse/storage/events.py
index bf4f3ee92a..c2910094d0 100644
--- a/synapse/storage/events.py
+++ b/synapse/storage/events.py
@@ -549,7 +549,12 @@ 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)
+            # We're only interested in pulling out state that has already
+            # been cached in the context. We'll pull stuff out of the DB later
+            # if necessary.
+            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