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

Commit

Permalink
synctl: print warning if synctl_cache_factor is set in config (#11865)
Browse files Browse the repository at this point in the history
Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
  • Loading branch information
lukasdenk and anoadragon453 authored Feb 28, 2022
1 parent b43c3ef commit ab3ef49
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog.d/11865.removal
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Deprecate using `synctl` with the config option `synctl_cache_factor` and print a warning if a user still uses this option.
8 changes: 8 additions & 0 deletions synctl
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ YELLOW = "\x1b[1;33m"
RED = "\x1b[1;31m"
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):
try:
Expand Down Expand Up @@ -228,6 +235,7 @@ def main():
start_stop_synapse = True

if cache_factor:
write(SYNCTL_CACHE_FACTOR_WARNING)
os.environ["SYNAPSE_CACHE_FACTOR"] = str(cache_factor)

cache_factors = config.get("synctl_cache_factors", {})
Expand Down

0 comments on commit ab3ef49

Please sign in to comment.