mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 10:26:06 -04:00
Use stream_change cache to make get_forward_extremeties_for_room cache more effective
This commit is contained in:
parent
55e6fc917c
commit
cb3edec6af
3 changed files with 19 additions and 2 deletions
|
@ -121,3 +121,8 @@ class StreamChangeCache(object):
|
|||
k, r = self._cache.popitem()
|
||||
self._earliest_known_stream_pos = max(k, self._earliest_known_stream_pos)
|
||||
self._entity_to_key.pop(r, None)
|
||||
|
||||
def get_pos_of_last_change(self, entity):
|
||||
"""Returns the stream pos of the last change for an entitiy, if known.
|
||||
"""
|
||||
return self._entity_to_key.get(entity, None)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue