Prefill forward extrems and event to state groups

This commit is contained in:
Erik Johnston 2017-06-29 15:38:48 +01:00
parent d800ab2847
commit 5946aa0877
2 changed files with 13 additions and 2 deletions

View file

@ -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={