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

Commit

Permalink
Remove redundant checks on daemonize from synctl (#7233)
Browse files Browse the repository at this point in the history
We pass --daemonize on the commandline, which (since at least #4853) overrides
whatever the config file, so there is no need for it to be set in the config
file.
  • Loading branch information
richvdh committed Apr 8, 2020
1 parent cae4121 commit 23f8d28
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
1 change: 1 addition & 0 deletions changelog.d/7233.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove redundant checks on `daemonize` from synctl.
20 changes: 11 additions & 9 deletions synctl
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,17 @@ def start_worker(app: str, configfile: str, worker_configfile: str) -> bool:
False if there was an error starting the process
"""

args = [sys.executable, "-B", "-m", app, "-c", configfile, "-c", worker_configfile]
args = [
sys.executable,
"-B",
"-m",
app,
"-c",
configfile,
"-c",
worker_configfile,
"--daemonize",
]

try:
subprocess.check_call(args)
Expand Down Expand Up @@ -266,9 +276,6 @@ def main():
worker_cache_factors = (
worker_config.get("synctl_cache_factors") or cache_factors
)
daemonize = worker_config.get("daemonize") or config.get("daemonize")
assert daemonize, "Main process must have daemonize set to true"

# The master process doesn't support using worker_* config.
for key in worker_config:
if key == "worker_app": # But we allow worker_app
Expand All @@ -278,11 +285,6 @@ def main():
), "Main process cannot use worker_* config"
else:
worker_pidfile = worker_config["worker_pid_file"]
worker_daemonize = worker_config["worker_daemonize"]
assert worker_daemonize, "In config %r: expected '%s' to be True" % (
worker_configfile,
"worker_daemonize",
)
worker_cache_factor = worker_config.get("synctl_cache_factor")
worker_cache_factors = worker_config.get("synctl_cache_factors", {})
workers.append(
Expand Down

0 comments on commit 23f8d28

Please sign in to comment.