diff options
author | Amber Brown <hawkowl@atleastfornow.net> | 2020-05-12 03:45:23 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-11 18:45:23 +0100 |
commit | 7cb8b4bc67042a39bd1b0e05df46089a2fce1955 (patch) | |
tree | 0dcb8d54969d325c55ea113e1b7a7bb18fd9aa65 /synapse/state/__init__.py | |
parent | Remove unused store method get_hosts_in_room (#7448) (diff) | |
download | synapse-7cb8b4bc67042a39bd1b0e05df46089a2fce1955.tar.xz |
Allow configuration of Synapse's cache without using synctl or environment variables (#6391)
Diffstat (limited to 'synapse/state/__init__.py')
-rw-r--r-- | synapse/state/__init__.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/synapse/state/__init__.py b/synapse/state/__init__.py index 4afefc6b1d..2fa529fcd0 100644 --- a/synapse/state/__init__.py +++ b/synapse/state/__init__.py @@ -35,7 +35,6 @@ from synapse.state import v1, v2 from synapse.storage.data_stores.main.events_worker import EventRedactBehaviour from synapse.types import StateMap from synapse.util.async_helpers import Linearizer -from synapse.util.caches import get_cache_factor_for from synapse.util.caches.expiringcache import ExpiringCache from synapse.util.metrics import Measure, measure_func @@ -53,7 +52,6 @@ state_groups_histogram = Histogram( KeyStateTuple = namedtuple("KeyStateTuple", ("context", "type", "state_key")) -SIZE_OF_CACHE = 100000 * get_cache_factor_for("state_cache") EVICTION_TIMEOUT_SECONDS = 60 * 60 @@ -447,7 +445,7 @@ class StateResolutionHandler(object): self._state_cache = ExpiringCache( cache_name="state_cache", clock=self.clock, - max_len=SIZE_OF_CACHE, + max_len=100000, expiry_ms=EVICTION_TIMEOUT_SECONDS * 1000, iterable=True, reset_expiry_on_get=True, |