Merge pull request #2927 from matrix-org/erikj/read_marker_caches

Improve caching for read_marker API
This commit is contained in:
Erik Johnston 2018-03-01 17:12:34 +00:00 committed by GitHub
commit 9e08a93a7b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 46 additions and 5 deletions

View file

@ -56,6 +56,10 @@ class SlavedAccountDataStore(TagsWorkerStore, AccountDataWorkerStore, BaseSlaved
(row.data_type, row.user_id,)
)
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
)