mirror of
https://github.com/element-hq/synapse.git
synced 2024-12-27 09:58:41 +00:00
Better all_entities_changed(stream_pos)
implementation
See https://github.com/element-hq/synapse/pull/17732#discussion_r1765815711
This commit is contained in:
parent
7e328d7ee7
commit
ac06ddfb02
|
@ -319,11 +319,9 @@ class StreamChangeCache:
|
|||
Mark all entities as changed. This is useful when the cache is invalidated and
|
||||
there may be some potential change for all of the entities.
|
||||
"""
|
||||
# All entities are at the same stream position now.
|
||||
self._cache = SortedDict({stream_pos: set(self._entity_to_key.keys())})
|
||||
self._entity_to_key = {
|
||||
entity: stream_pos for entity in self._entity_to_key.keys()
|
||||
}
|
||||
self._cache.clear()
|
||||
self._entity_to_key.clear()
|
||||
self._earliest_known_stream_pos = stream_pos
|
||||
|
||||
def _evict(self) -> None:
|
||||
"""
|
||||
|
|
Loading…
Reference in a new issue