summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2018-08-20 13:33:35 +0100
committerGitHub <noreply@github.com>2018-08-20 13:33:35 +0100
commitcf6f9a8b5315d7d2ff4f96d3a183141aef354fd8 (patch)
treeef4e7f1494d66aade81f8ac07a7d528d743bb889
parentMerge pull request #3713 from matrix-org/erikj/fixup_fed_logging (diff)
parentNewsfile (diff)
downloadsynapse-cf6f9a8b5315d7d2ff4f96d3a183141aef354fd8.tar.xz
Merge pull request #3719 from matrix-org/erikj/use_cache_fact
Use get_cache_factor_for function for `state_cache`
-rw-r--r--changelog.d/3719.bugfix1
-rw-r--r--synapse/state.py4
2 files changed, 3 insertions, 2 deletions
diff --git a/changelog.d/3719.bugfix b/changelog.d/3719.bugfix
new file mode 100644
index 0000000000..095d9288e8
--- /dev/null
+++ b/changelog.d/3719.bugfix
@@ -0,0 +1 @@
+Fix bug where `state_cache` cache factor ignored environment variables
diff --git a/synapse/state.py b/synapse/state.py
index 8b92d4057a..0f2bedb694 100644
--- a/synapse/state.py
+++ b/synapse/state.py
@@ -29,7 +29,7 @@ from synapse.api.constants import EventTypes
 from synapse.api.errors import AuthError
 from synapse.events.snapshot import EventContext
 from synapse.util.async_helpers import Linearizer
-from synapse.util.caches import CACHE_SIZE_FACTOR
+from synapse.util.caches import get_cache_factor_for
 from synapse.util.caches.expiringcache import ExpiringCache
 from synapse.util.logutils import log_function
 from synapse.util.metrics import Measure
@@ -40,7 +40,7 @@ logger = logging.getLogger(__name__)
 KeyStateTuple = namedtuple("KeyStateTuple", ("context", "type", "state_key"))
 
 
-SIZE_OF_CACHE = int(100000 * CACHE_SIZE_FACTOR)
+SIZE_OF_CACHE = 100000 * get_cache_factor_for("state_cache")
 EVICTION_TIMEOUT_SECONDS = 60 * 60