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

Print warning if synctl_cache_factor is set in config #11865

Merged
merged 8 commits into from
Feb 28, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Print warning if synctl_cache_factor is set in config
lukasdenk committed Jan 31, 2022
commit 6026a5e505e5f86fd915df3c54a460a1385fc2f5
11 changes: 11 additions & 0 deletions synctl
Original file line number Diff line number Diff line change
@@ -18,6 +18,7 @@ import argparse
import collections
import errno
import glob
import logging
import os
import os.path
import signal
@@ -37,6 +38,15 @@ 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 configs.
--------------------------------------------------------------------------------"""

logger = logging.getLogger(__name__)


def pid_running(pid):
try:
@@ -228,6 +238,7 @@ def main():
start_stop_synapse = True

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

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