summary refs log tree commit diff
path: root/synapse/storage/_base.py
diff options
context:
space:
mode:
authorOlivier Wilkinson (reivilibre) <olivier@librepush.net>2019-08-29 15:02:09 +0100
committerOlivier Wilkinson (reivilibre) <olivier@librepush.net>2019-08-29 15:02:09 +0100
commit60481031f2f1e43aaedc96a33441bfcf15262330 (patch)
treeb7f1e9e461e3034b1ca0fd75e6ea4ea185986cfb /synapse/storage/_base.py
parentCount total_events and total_event_bytes within the loop. (diff)
parentMerge branch 'develop' into rei/rss_target (diff)
downloadsynapse-rei/rss_inc5.tar.xz
Merge branch 'rei/rss_target' into rei/rss_inc5 github/rei/rss_inc5 rei/rss_inc5
Diffstat (limited to 'synapse/storage/_base.py')
-rw-r--r--synapse/storage/_base.py24
1 files changed, 16 insertions, 8 deletions
diff --git a/synapse/storage/_base.py b/synapse/storage/_base.py

index 489ce82fae..abe16334ec 100644 --- a/synapse/storage/_base.py +++ b/synapse/storage/_base.py
@@ -1395,14 +1395,22 @@ class SQLBaseStore(object): """ txn.call_after(self._invalidate_state_caches, room_id, members_changed) - # We need to be careful that the size of the `members_changed` list - # isn't so large that it causes problems sending over replication, so we - # send them in chunks. - # Max line length is 16K, and max user ID length is 255, so 50 should - # be safe. - for chunk in batch_iter(members_changed, 50): - keys = itertools.chain([room_id], chunk) - self._send_invalidation_to_replication(txn, _CURRENT_STATE_CACHE_NAME, keys) + if members_changed: + # We need to be careful that the size of the `members_changed` list + # isn't so large that it causes problems sending over replication, so we + # send them in chunks. + # Max line length is 16K, and max user ID length is 255, so 50 should + # be safe. + for chunk in batch_iter(members_changed, 50): + keys = itertools.chain([room_id], chunk) + self._send_invalidation_to_replication( + txn, _CURRENT_STATE_CACHE_NAME, keys + ) + else: + # if no members changed, we still need to invalidate the other caches. + self._send_invalidation_to_replication( + txn, _CURRENT_STATE_CACHE_NAME, [room_id] + ) def _invalidate_state_caches(self, room_id, members_changed): """Invalidates caches that are based on the current state, but does