Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #3719 from matrix-org/erikj/use_cache_fact
Browse files Browse the repository at this point in the history
Use get_cache_factor_for function for `state_cache`
  • Loading branch information
erikjohnston committed Aug 20, 2018
2 parents 2aa7cc6 + 48a910e commit cf6f9a8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.d/3719.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix bug where `state_cache` cache factor ignored environment variables
4 changes: 2 additions & 2 deletions synapse/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
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
Expand All @@ -40,7 +40,7 @@
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


Expand Down

0 comments on commit cf6f9a8

Please sign in to comment.