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.
This commit is contained in:
Erik Johnston 2018-03-01 15:53:04 +00:00
parent 33bebb63f3
commit a83c514d1f
3 changed files with 41 additions and 3 deletions

View file

@ -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
)