summary refs log tree commit diff
diff options
context:
space:
mode:
authorDavid Baker <dave@matrix.org>2016-01-22 13:40:37 +0000
committerDavid Baker <dave@matrix.org>2016-01-22 13:40:37 +0000
commit7cd418d38e472563d8df6546b3227dcfafe3e145 (patch)
tree740e160954c47d5362c22661bb141c31cdfbf118
parentdocs (diff)
downloadsynapse-7cd418d38e472563d8df6546b3227dcfafe3e145.tar.xz
Don't add the member functiopn if we're not using treecache
-rw-r--r--synapse/util/caches/lrucache.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/synapse/util/caches/lrucache.py b/synapse/util/caches/lrucache.py
index cc6c25a712..e6a66dc041 100644
--- a/synapse/util/caches/lrucache.py
+++ b/synapse/util/caches/lrucache.py
@@ -17,6 +17,8 @@
 from functools import wraps
 import threading
 
+from synapse.util.caches.treecache import TreeCache
+
 
 def enumerate_leaves(node, depth):
     if depth == 0:
@@ -154,7 +156,8 @@ class LruCache(object):
         self.set = cache_set
         self.setdefault = cache_set_default
         self.pop = cache_pop
-        self.del_multi = cache_del_multi
+        if cache_type is TreeCache:
+            self.del_multi = cache_del_multi
         self.len = cache_len
         self.contains = cache_contains
         self.clear = cache_clear