diff options
author | Erik Johnston <erik@matrix.org> | 2016-01-28 14:45:36 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2016-01-28 14:45:36 +0000 |
commit | 167d1df699d64683f1f9ace759c772af1890ca56 (patch) | |
tree | a9222f66b36c828df5ca2fcd455db820dcd80dca /synapse/storage/receipts.py | |
parent | Quot all the things (diff) | |
parent | Clean up a bit. Add comment (diff) | |
download | synapse-167d1df699d64683f1f9ace759c772af1890ca56.tar.xz |
Merge pull request #534 from matrix-org/erikj/setup
Add a Homeserver.setup method
Diffstat (limited to 'synapse/storage/receipts.py')
-rw-r--r-- | synapse/storage/receipts.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/synapse/storage/receipts.py b/synapse/storage/receipts.py index c4232bdc65..c0593e23ee 100644 --- a/synapse/storage/receipts.py +++ b/synapse/storage/receipts.py @@ -31,7 +31,9 @@ class ReceiptsStore(SQLBaseStore): def __init__(self, hs): super(ReceiptsStore, self).__init__(hs) - self._receipts_stream_cache = _RoomStreamChangeCache() + self._receipts_stream_cache = _RoomStreamChangeCache( + self._receipts_id_gen.get_max_token(None) + ) @cached(num_args=2) def get_receipts_for_room(self, room_id, receipt_type): @@ -377,11 +379,11 @@ class _RoomStreamChangeCache(object): may have changed since that key. If the key is too old then the cache will simply return all rooms. """ - def __init__(self, size_of_cache=10000): + def __init__(self, current_key, size_of_cache=10000): self._size_of_cache = size_of_cache self._room_to_key = {} self._cache = sorteddict() - self._earliest_key = None + self._earliest_key = current_key self.name = "ReceiptsRoomChangeCache" caches_by_name[self.name] = self._cache |