summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2017-02-01 13:22:02 +0000
committerGitHub <noreply@github.com>2017-02-01 13:22:02 +0000
commitebfaff84c9ea052a28110badd4c2237e08557b0d (patch)
tree38f9323c63a7eb60791c2b87935b9c3c567db3c0
parentMerge pull request #1868 from matrix-org/erikj/replication_cache (diff)
parentAdd a small cache get_all_new_events (diff)
downloadsynapse-ebfaff84c9ea052a28110badd4c2237e08557b0d.tar.xz
Merge pull request #1870 from matrix-org/erikj/cache_get_all_new_events
Add a small cache get_all_new_events
Diffstat (limited to '')
-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 f4352b326b..8659f605a5 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
@@ -1571,6 +1572,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