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

@ -41,9 +41,9 @@ class ReadMarkerHandler(BaseHandler):
"""
with (yield self.read_marker_linearizer.queue((room_id, user_id))):
account_data = yield self.store.get_account_data_for_room(user_id, room_id)
existing_read_marker = account_data.get("m.fully_read", None)
existing_read_marker = yield self.store.get_account_data_for_room_and_type(
user_id, room_id, "m.fully_read",
)
should_update = True