Skip to content
Snippets Groups Projects
Unverified Commit ab3ef490 authored by lukasdenk's avatar lukasdenk Committed by GitHub
Browse files

synctl: print warning if synctl_cache_factor is set in config (#11865)

parent b43c3ef8
No related branches found
No related tags found
No related merge requests found
Deprecate using `synctl` with the config option `synctl_cache_factor` and print a warning if a user still uses this option.
...@@ -37,6 +37,13 @@ YELLOW = "\x1b[1;33m" ...@@ -37,6 +37,13 @@ YELLOW = "\x1b[1;33m"
RED = "\x1b[1;31m" RED = "\x1b[1;31m"
NORMAL = "\x1b[m" NORMAL = "\x1b[m"
SYNCTL_CACHE_FACTOR_WARNING = """\
Setting 'synctl_cache_factor' in the config is deprecated. Instead, please do
one of the following:
- Either set the environment variable 'SYNAPSE_CACHE_FACTOR'
- or set 'caches.global_factor' in the homeserver config.
--------------------------------------------------------------------------------"""
def pid_running(pid): def pid_running(pid):
try: try:
...@@ -228,6 +235,7 @@ def main(): ...@@ -228,6 +235,7 @@ def main():
start_stop_synapse = True start_stop_synapse = True
if cache_factor: if cache_factor:
write(SYNCTL_CACHE_FACTOR_WARNING)
os.environ["SYNAPSE_CACHE_FACTOR"] = str(cache_factor) os.environ["SYNAPSE_CACHE_FACTOR"] = str(cache_factor)
cache_factors = config.get("synctl_cache_factors", {}) cache_factors = config.get("synctl_cache_factors", {})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment