summary refs log tree commit diff
path: root/synapse/storage/state.py
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2017-06-30 11:03:04 +0100
committerGitHub <noreply@github.com>2017-06-30 11:03:04 +0100
commit47574c9cbaa183acfccde9cc0c6b30dfa0fbc2fd (patch)
tree43a5d5ba21df1a39d8052b5e4d55c3398413a61d /synapse/storage/state.py
parentMerge pull request #2320 from matrix-org/erikj/cache_macaroon_parse (diff)
parentMake into list (diff)
downloadsynapse-47574c9cbaa183acfccde9cc0c6b30dfa0fbc2fd.tar.xz
Merge pull request #2321 from matrix-org/erikj/prefill_forward
Prefill forward extrems and event to state groups
Diffstat (limited to 'synapse/storage/state.py')
-rw-r--r--synapse/storage/state.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/synapse/storage/state.py b/synapse/storage/state.py
index d1e679719b..5673e4aa96 100644
--- a/synapse/storage/state.py
+++ b/synapse/storage/state.py
@@ -315,6 +315,12 @@ class StateStore(SQLBaseStore):
             ],
         )
 
+        for event_id, state_group_id in state_groups.iteritems():
+            txn.call_after(
+                self._get_state_group_for_event.prefill,
+                (event_id,), state_group_id
+            )
+
     def _count_state_group_hops_txn(self, txn, state_group):
         """Given a state group, count how many hops there are in the tree.
 
@@ -584,8 +590,8 @@ class StateStore(SQLBaseStore):
         state_map = yield self.get_state_ids_for_events([event_id], types)
         defer.returnValue(state_map[event_id])
 
-    @cached(num_args=2, max_entries=50000)
-    def _get_state_group_for_event(self, room_id, event_id):
+    @cached(max_entries=50000)
+    def _get_state_group_for_event(self, event_id):
         return self._simple_select_one_onecol(
             table="event_to_state_groups",
             keyvalues={