summary refs log tree commit diff
path: root/synapse/storage/stream.py
diff options
context:
space:
mode:
authorPaul "LeoNerd" Evans <paul@matrix.org>2015-03-20 15:44:06 +0000
committerPaul "LeoNerd" Evans <paul@matrix.org>2015-03-20 15:44:06 +0000
commitceb61daa70d30b56584bab61e17e68fd868d5264 (patch)
tree2709ec5c62e83aa3416c52f35d0a976358cf6dfc /synapse/storage/stream.py
parentAllow @cached-wrapped functions to have more or fewer than 1 argument; assert... (diff)
downloadsynapse-ceb61daa70d30b56584bab61e17e68fd868d5264.tar.xz
Add the tiniest of tiny one-element caches to get_room_events_max_id() as it's read every time someone hits eventstream
Diffstat (limited to 'synapse/storage/stream.py')
-rw-r--r--synapse/storage/stream.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/synapse/storage/stream.py b/synapse/storage/stream.py
index 09bc522210..850ab9e0e3 100644
--- a/synapse/storage/stream.py
+++ b/synapse/storage/stream.py
@@ -35,7 +35,7 @@ what sort order was used:
 
 from twisted.internet import defer
 
-from ._base import SQLBaseStore
+from ._base import SQLBaseStore, cached
 from synapse.api.constants import EventTypes
 from synapse.api.errors import SynapseError
 from synapse.util.logutils import log_function
@@ -413,6 +413,7 @@ class StreamStore(SQLBaseStore):
             "get_recent_events_for_room", get_recent_events_for_room_txn
         )
 
+    @cached(num_args=0)
     def get_room_events_max_id(self):
         return self.runInteraction(
             "get_room_events_max_id",