summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2016-09-15 14:06:55 +0100
committerGitHub <noreply@github.com>2016-09-15 14:06:55 +0100
commit923f77cff3078106c5f7dfdc997fa91fce4e8e6c (patch)
tree51f8181e49bbf9e29207f3620d90c83f712c666e /synapse
parentRemove default public rooms limit (diff)
parentAdd cache to get_forward_extremeties_for_room (diff)
downloadsynapse-923f77cff3078106c5f7dfdc997fa91fce4e8e6c.tar.xz
Merge pull request #1122 from matrix-org/erikj/public_room_cache
Add cache to get_forward_extremeties_for_room
Diffstat (limited to 'synapse')
-rw-r--r--synapse/replication/slave/storage/events.py2
-rw-r--r--synapse/storage/event_federation.py1
2 files changed, 2 insertions, 1 deletions
diff --git a/synapse/replication/slave/storage/events.py b/synapse/replication/slave/storage/events.py
index f8965c73a0..842ced02d6 100644
--- a/synapse/replication/slave/storage/events.py
+++ b/synapse/replication/slave/storage/events.py
@@ -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):
diff --git a/synapse/storage/event_federation.py b/synapse/storage/event_federation.py
index ec6dbe5492..050b78d652 100644
--- a/synapse/storage/event_federation.py
+++ b/synapse/storage/event_federation.py
@@ -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".