Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Comments
Browse files Browse the repository at this point in the history
  • Loading branch information
erikjohnston committed Jul 23, 2018
1 parent 2d5bba1 commit 8b9f164
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 3 additions & 2 deletions synapse/events/snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,9 @@ def get_cached_current_state_ids(self):
"""Gets the current state IDs if we have them already cached.
Returns:
dict[(str, str), str]|None: Returns None if state_group
is None, which happens when the associated event is an outlier.
dict[(str, str), str]|None: Returns None if we haven't cached the
state or if state_group is None, which happens when the associated
event is an outlier.
"""

return self._current_state_ids
Expand Down
3 changes: 3 additions & 0 deletions synapse/storage/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,9 @@ def _get_new_state_after_events(self, room_id, events_context, old_latest_event_
if ctx.state_group in state_groups_map:
continue

# 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
Expand Down

0 comments on commit 8b9f164

Please sign in to comment.