Make LRU cache not default to treecache & add options to use it

This commit is contained in:
David Baker 2016-01-22 12:10:33 +00:00
parent 5b142788d2
commit 10f76dc5da
4 changed files with 29 additions and 19 deletions

View file

@ -17,6 +17,7 @@
from .. import unittest
from synapse.util.caches.lrucache import LruCache
from synapse.util.caches.treecache import TreeCache
class LruCacheTestCase(unittest.TestCase):
@ -54,7 +55,7 @@ class LruCacheTestCase(unittest.TestCase):
self.assertEquals(cache.pop(("key",)), None)
def test_del_multi(self):
cache = LruCache(4, 2)
cache = LruCache(4, 2, cache_type=TreeCache)
cache[("animal", "cat")] = "mew"
cache[("animal", "dog")] = "woof"
cache[("vehicles", "car")] = "vroom"