summary refs log tree commit diff
path: root/synapse/storage/databases/main/receipts.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2022-04-07 13:31:07 +0100
committerErik Johnston <erik@matrix.org>2022-04-07 13:34:23 +0100
commitc37cd85d8aa435f2956eb1a3f281d201b907daf1 (patch)
tree99f567b6e4782e5b556b3ac311269a20c4a60203 /synapse/storage/databases/main/receipts.py
parentMerge remote-tracking branch 'origin/release-v1.56' into matrix-org-hotfixes (diff)
parentAdd opentracing spans to calls to external cache (#12380) (diff)
downloadsynapse-c37cd85d8aa435f2956eb1a3f281d201b907daf1.tar.xz
Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes
Diffstat (limited to 'synapse/storage/databases/main/receipts.py')
-rw-r--r--synapse/storage/databases/main/receipts.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/synapse/storage/databases/main/receipts.py b/synapse/storage/databases/main/receipts.py

index e6f97aeece..332e901dda 100644 --- a/synapse/storage/databases/main/receipts.py +++ b/synapse/storage/databases/main/receipts.py
@@ -98,8 +98,19 @@ class ReceiptsWorkerStore(SQLBaseStore): super().__init__(database, db_conn, hs) + max_receipts_stream_id = self.get_max_receipt_stream_id() + receipts_stream_prefill, min_receipts_stream_id = self.db_pool.get_cache_dict( + db_conn, + "receipts_linearized", + entity_column="room_id", + stream_column="stream_id", + max_value=max_receipts_stream_id, + limit=10000, + ) self._receipts_stream_cache = StreamChangeCache( - "ReceiptsRoomChangeCache", self.get_max_receipt_stream_id() + "ReceiptsRoomChangeCache", + min_receipts_stream_id, + prefilled_cache=receipts_stream_prefill, ) def get_max_receipt_stream_id(self) -> int: