mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-08 00:45:00 -04:00
Allow configuration of Synapse's cache without using synctl or environment variables (#6391)
This commit is contained in:
parent
a8580c5f19
commit
7cb8b4bc67
32 changed files with 620 additions and 146 deletions
|
@ -25,8 +25,8 @@ from synapse.util.caches.descriptors import Cache, cached
|
|||
from tests import unittest
|
||||
|
||||
|
||||
class CacheTestCase(unittest.TestCase):
|
||||
def setUp(self):
|
||||
class CacheTestCase(unittest.HomeserverTestCase):
|
||||
def prepare(self, reactor, clock, homeserver):
|
||||
self.cache = Cache("test")
|
||||
|
||||
def test_empty(self):
|
||||
|
@ -96,7 +96,7 @@ class CacheTestCase(unittest.TestCase):
|
|||
cache.get(3)
|
||||
|
||||
|
||||
class CacheDecoratorTestCase(unittest.TestCase):
|
||||
class CacheDecoratorTestCase(unittest.HomeserverTestCase):
|
||||
@defer.inlineCallbacks
|
||||
def test_passthrough(self):
|
||||
class A(object):
|
||||
|
@ -239,7 +239,7 @@ class CacheDecoratorTestCase(unittest.TestCase):
|
|||
callcount2 = [0]
|
||||
|
||||
class A(object):
|
||||
@cached(max_entries=4) # HACK: This makes it 2 due to cache factor
|
||||
@cached(max_entries=2)
|
||||
def func(self, key):
|
||||
callcount[0] += 1
|
||||
return key
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue