summary refs log tree commit diff
path: root/synapse/storage/_base.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-08-06 13:35:28 +0100
committerErik Johnston <erik@matrix.org>2015-08-06 13:35:28 +0100
commit2efb93af529db0beecd4ff023c9d7f1cdadac0aa (patch)
tree41f592ee25114a50ae4b699e9d04136942161c3c /synapse/storage/_base.py
parentMake @cached cache deferreds rather than the deferreds' values (diff)
parentMerge branch 'develop' of github.com:matrix-org/synapse into erikj/cached_key... (diff)
downloadsynapse-2efb93af529db0beecd4ff023c9d7f1cdadac0aa.tar.xz
Merge branch 'erikj/cached_keyword_args' into erikj/cache_deferreds
Diffstat (limited to 'synapse/storage/_base.py')
-rw-r--r--synapse/storage/_base.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/synapse/storage/_base.py b/synapse/storage/_base.py
index 8604d38c3e..7b2be6745e 100644
--- a/synapse/storage/_base.py
+++ b/synapse/storage/_base.py
@@ -59,7 +59,7 @@ cache_counter = metrics.register_cache(
 
 class Cache(object):
 
-    def __init__(self, name, max_entries=1000, keylen=1, lru=False):
+    def __init__(self, name, max_entries=1000, keylen=1, lru=True):
         if lru:
             self.cache = LruCache(max_size=max_entries)
             self.max_entries = None
@@ -143,7 +143,7 @@ class CacheDescriptor(object):
     which can be used to insert values into the cache specifically, without
     calling the calculation function.
     """
-    def __init__(self, orig, max_entries=1000, num_args=1, lru=False,
+    def __init__(self, orig, max_entries=1000, num_args=1, lru=True,
                  inlineCallbacks=False):
         self.orig = orig
 
@@ -205,7 +205,7 @@ class CacheDescriptor(object):
         return wrapped
 
 
-def cached(max_entries=1000, num_args=1, lru=False):
+def cached(max_entries=1000, num_args=1, lru=True):
     return lambda orig: CacheDescriptor(
         orig,
         max_entries=max_entries,