mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 00:34:47 -04:00
Make LRU cache not default to treecache & add options to use it
This commit is contained in:
parent
5b142788d2
commit
10f76dc5da
4 changed files with 29 additions and 19 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue