summary refs log tree commit diff
path: root/synapse/replication/slave/storage
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2018-03-01 15:53:04 +0000
committerErik Johnston <erik@matrix.org>2018-03-01 17:08:17 +0000
commita83c514d1f8e1573246e0235c97ba140cbff12db (patch)
tree804c9d8da51efc28551c2d4845f76a7b85ad8b95 /synapse/replication/slave/storage
parentAdd some caches to help read marker API (diff)
downloadsynapse-a83c514d1f8e1573246e0235c97ba140cbff12db.tar.xz
Improve caching for read_marker API
We add a new storage function to get a paritcular type of room account
data. This allows us to prefill the cache when updating that acount
data.
Diffstat (limited to 'synapse/replication/slave/storage')
-rw-r--r--synapse/replication/slave/storage/account_data.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/synapse/replication/slave/storage/account_data.py b/synapse/replication/slave/storage/account_data.py
index 970ac4c24d..355d14ff7c 100644
--- a/synapse/replication/slave/storage/account_data.py
+++ b/synapse/replication/slave/storage/account_data.py
@@ -57,6 +57,9 @@ class SlavedAccountDataStore(TagsWorkerStore, AccountDataWorkerStore, BaseSlaved
                     )
                 self.get_account_data_for_user.invalidate((row.user_id,))
                 self.get_account_data_for_room.invalidate((row.user_id, row.room_id,))
+                self.get_account_data_for_room_and_type.invalidate(
+                    (row.user_id, row.room_id, row.account_data_type,),
+                )
                 self._account_data_stream_cache.entity_has_changed(
                     row.user_id, token
                 )