diff options
author | Erik Johnston <erik@matrix.org> | 2017-05-17 10:03:09 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2017-05-17 10:03:09 +0100 |
commit | 85e8092ccab2b7a479b71225fc24e69a2f58f980 (patch) | |
tree | 0dbaac31d7e6dfa24a3657abe8b9e0490287f06a /synapse/storage/roommember.py | |
parent | Short circuit when we have delta ids (diff) | |
download | synapse-85e8092ccab2b7a479b71225fc24e69a2f58f980.tar.xz |
Comment
Diffstat (limited to 'synapse/storage/roommember.py')
-rw-r--r-- | synapse/storage/roommember.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/synapse/storage/roommember.py b/synapse/storage/roommember.py index a5df1d46b4..0829ae5bee 100644 --- a/synapse/storage/roommember.py +++ b/synapse/storage/roommember.py @@ -420,7 +420,12 @@ class RoomMemberStore(SQLBaseStore): for key, e_id in current_state_ids.iteritems() if key[0] == EventTypes.Member ] + if context is not None: + # If we have a context with a delta from a previous state group, + # check if we also have the result from the previous group in cache. + # If we do then we can reuse that result and simply update it with + # any membership changes in `delta_ids` if context.prev_group and context.delta_ids: prev_res = self._get_joined_users_from_context.cache.get( (room_id, context.prev_group), None |