diff options
author | Erik Johnston <erik@matrix.org> | 2018-03-01 15:53:04 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2018-03-01 17:08:17 +0000 |
commit | a83c514d1f8e1573246e0235c97ba140cbff12db (patch) | |
tree | 804c9d8da51efc28551c2d4845f76a7b85ad8b95 /synapse/handlers | |
parent | Add some caches to help read marker API (diff) | |
download | synapse-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/handlers')
-rw-r--r-- | synapse/handlers/read_marker.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/synapse/handlers/read_marker.py b/synapse/handlers/read_marker.py index b5b0303d54..5142ae153d 100644 --- a/synapse/handlers/read_marker.py +++ b/synapse/handlers/read_marker.py @@ -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 |