diff options
author | Erik Johnston <erikj@jki.re> | 2018-02-27 11:34:26 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-27 11:34:26 +0000 |
commit | 3594dbc6dc088b2a02eb9906a391602ad4213639 (patch) | |
tree | 98c8c8e1e1f883d052721c31767f920cb6e66a01 /synapse/storage | |
parent | Merge pull request #2903 from matrix-org/erikj/split_roommember_store (diff) | |
parent | Fix missing invalidations for receipt storage (diff) | |
download | synapse-3594dbc6dc088b2a02eb9906a391602ad4213639.tar.xz |
Merge pull request #2904 from matrix-org/erikj/receipt_cache_invalidation
Fix missing invalidations for receipt storage
Diffstat (limited to 'synapse/storage')
-rw-r--r-- | synapse/storage/receipts.py | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/synapse/storage/receipts.py b/synapse/storage/receipts.py index 40530632c6..eac8694e0f 100644 --- a/synapse/storage/receipts.py +++ b/synapse/storage/receipts.py @@ -292,20 +292,6 @@ class ReceiptsWorkerStore(SQLBaseStore): "get_all_updated_receipts", get_all_updated_receipts_txn ) - -class ReceiptsStore(ReceiptsWorkerStore): - def __init__(self, db_conn, hs): - # We instantiate this first as the ReceiptsWorkerStore constructor - # needs to be able to call get_max_receipt_stream_id - self._receipts_id_gen = StreamIdGenerator( - db_conn, "receipts_linearized", "stream_id" - ) - - super(ReceiptsStore, self).__init__(db_conn, hs) - - def get_max_receipt_stream_id(self): - return self._receipts_id_gen.get_current_token() - def _invalidate_get_users_with_receipts_in_room(self, room_id, receipt_type, user_id): if receipt_type != "m.read": @@ -326,6 +312,20 @@ class ReceiptsStore(ReceiptsWorkerStore): self.get_users_with_read_receipts_in_room.invalidate((room_id,)) + +class ReceiptsStore(ReceiptsWorkerStore): + def __init__(self, db_conn, hs): + # We instantiate this first as the ReceiptsWorkerStore constructor + # needs to be able to call get_max_receipt_stream_id + self._receipts_id_gen = StreamIdGenerator( + db_conn, "receipts_linearized", "stream_id" + ) + + super(ReceiptsStore, self).__init__(db_conn, hs) + + def get_max_receipt_stream_id(self): + return self._receipts_id_gen.get_current_token() + def insert_linearized_receipt_txn(self, txn, room_id, receipt_type, user_id, event_id, data, stream_id): txn.call_after( |