summary refs log tree commit diff
path: root/synapse/storage/receipts.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-01-28 15:02:37 +0000
committerErik Johnston <erik@matrix.org>2016-01-28 15:02:41 +0000
commite1941442d442fe62570551071edfd936304697e7 (patch)
treed0472b1d793fbb5942eb27fbd37e9d400c0aa742 /synapse/storage/receipts.py
parentMerge branch 'develop' of github.com:matrix-org/synapse into erikj/sync (diff)
downloadsynapse-e1941442d442fe62570551071edfd936304697e7.tar.xz
Invalidate caches properly. Remove unused arg
Diffstat (limited to 'synapse/storage/receipts.py')
-rw-r--r--synapse/storage/receipts.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/synapse/storage/receipts.py b/synapse/storage/receipts.py

index 7118368d97..5ffbfdec51 100644 --- a/synapse/storage/receipts.py +++ b/synapse/storage/receipts.py
@@ -78,7 +78,7 @@ class ReceiptsStore(SQLBaseStore): if from_key: room_ids = yield self._receipts_stream_cache.get_rooms_changed( - self, room_ids, from_key + room_ids, from_key ) results = yield self._get_linearized_receipts_for_rooms( @@ -221,6 +221,11 @@ class ReceiptsStore(SQLBaseStore): # FIXME: This shouldn't invalidate the whole cache txn.call_after(self.get_linearized_receipts_for_room.invalidate_all) + txn.call_after( + self._receipts_stream_cache.room_has_changed, + room_id, stream_id + ) + # We don't want to clobber receipts for more recent events, so we # have to compare orderings of existing receipts sql = ( @@ -308,9 +313,6 @@ class ReceiptsStore(SQLBaseStore): stream_id_manager = yield self._receipts_id_gen.get_next(self) with stream_id_manager as stream_id: - yield self._receipts_stream_cache.room_has_changed( - self, room_id, stream_id - ) have_persisted = yield self.runInteraction( "insert_linearized_receipt", self.insert_linearized_receipt_txn,