diff options
author | Erik Johnston <erik@matrix.org> | 2016-02-09 13:55:59 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2016-02-09 13:55:59 +0000 |
commit | eff12e838ce10588ca8103c9131dcfe2f2e7950e (patch) | |
tree | 959d834a1f7abf447edba2528615e8088454ab84 /synapse/storage | |
parent | Fix unit tests (diff) | |
download | synapse-eff12e838ce10588ca8103c9131dcfe2f2e7950e.tar.xz |
Don't load all ephemeral state for a room on every sync
Diffstat (limited to '')
-rw-r--r-- | synapse/storage/receipts.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/synapse/storage/receipts.py b/synapse/storage/receipts.py index 8068c73740..1aff9f070e 100644 --- a/synapse/storage/receipts.py +++ b/synapse/storage/receipts.py @@ -46,6 +46,20 @@ class ReceiptsStore(SQLBaseStore): desc="get_receipts_for_room", ) + @cached(num_args=3) + def get_last_receipt_event_id_for_user(self, user_id, room_id, receipt_type): + return self._simple_select_one_onecol( + table="receipts_linearized", + keyvalues={ + "room_id": room_id, + "receipt_type": receipt_type, + "user_id": user_id + }, + retcol="event_id", + desc="get_own_receipt_for_user", + allow_none=True, + ) + @cachedInlineCallbacks(num_args=2) def get_receipts_for_user(self, user_id, receipt_type): def f(txn): |