mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 11:16:07 -04:00
Add hacky cache factor override system
This commit is contained in:
parent
5dbf305444
commit
042eedfa2b
4 changed files with 18 additions and 4 deletions
|
@ -22,6 +22,16 @@ import six
|
|||
|
||||
CACHE_SIZE_FACTOR = float(os.environ.get("SYNAPSE_CACHE_FACTOR", 0.5))
|
||||
|
||||
|
||||
def get_cache_factor_for(cache_name):
|
||||
env_var = "SYNAPSE_CACHE_FACTOR_" + cache_name.upper()
|
||||
factor = os.environ.get(env_var)
|
||||
if factor:
|
||||
return float(factor)
|
||||
|
||||
return CACHE_SIZE_FACTOR
|
||||
|
||||
|
||||
caches_by_name = {}
|
||||
collectors_by_name = {}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue