summary refs log tree commit diff
path: root/synapse/storage/events.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2017-02-01 10:42:37 +0000
committerErik Johnston <erik@matrix.org>2017-02-01 10:50:44 +0000
commit368c88c4870f797cee7775acaa2caec2753b7f91 (patch)
tree28911102cc34c3abe0c809dc87de4a6cb98aa668 /synapse/storage/events.py
parentUp get_latest_event_ids_in_room cache (diff)
downloadsynapse-368c88c4870f797cee7775acaa2caec2753b7f91.tar.xz
Add a small cache get_all_new_events
Diffstat (limited to 'synapse/storage/events.py')
-rw-r--r--synapse/storage/events.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/synapse/storage/events.py b/synapse/storage/events.py
index 6685b9da1c..332da25783 100644
--- a/synapse/storage/events.py
+++ b/synapse/storage/events.py
@@ -28,6 +28,7 @@ from synapse.util.metrics import Measure
 from synapse.api.constants import EventTypes
 from synapse.api.errors import SynapseError
 from synapse.state import resolve_events
+from synapse.util.caches.descriptors import cached
 
 from canonicaljson import encode_canonical_json
 from collections import deque, namedtuple, OrderedDict
@@ -1579,6 +1580,7 @@ class EventsStore(SQLBaseStore):
         """The current minimum token that backfilled events have reached"""
         return -self._backfill_id_gen.get_current_token()
 
+    @cached(num_args=5, max_entries=10)
     def get_all_new_events(self, last_backfill_id, last_forward_id,
                            current_backfill_id, current_forward_id, limit):
         """Get all the new events that have arrived at the server either as