mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-30 00:14:57 +03:00
Merge pull request #1122 from matrix-org/erikj/public_room_cache
Add cache to get_forward_extremeties_for_room
This commit is contained in:
commit
923f77cff3
2 changed files with 2 additions and 1 deletions
|
@ -173,7 +173,7 @@ class SlavedEventStore(BaseSlavedStore):
|
|||
get_room_max_stream_ordering = DataStore.get_room_max_stream_ordering.__func__
|
||||
|
||||
get_forward_extremeties_for_room = (
|
||||
DataStore.get_forward_extremeties_for_room.__func__
|
||||
EventFederationStore.__dict__["get_forward_extremeties_for_room"]
|
||||
)
|
||||
|
||||
def stream_positions(self):
|
||||
|
|
|
@ -344,6 +344,7 @@ class EventFederationStore(SQLBaseStore):
|
|||
self.get_latest_event_ids_in_room.invalidate, (room_id,)
|
||||
)
|
||||
|
||||
@cached(max_entries=5000, num_args=2)
|
||||
def get_forward_extremeties_for_room(self, room_id, stream_ordering):
|
||||
"""For a given room_id and stream_ordering, return the forward
|
||||
extremeties of the room at that point in "time".
|
||||
|
|
Loading…
Reference in a new issue