Skip to content

Commit d1a6b66

Browse files
richvdhphil-flex
authored andcommitted
Remove redundant checks on daemonize from synctl (matrix-org#7233)
We pass --daemonize on the commandline, which (since at least matrix-org#4853) overrides whatever the config file, so there is no need for it to be set in the config file.
1 parent 63e4b0c commit d1a6b66

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

changelog.d/7233.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Remove redundant checks on `daemonize` from synctl.

synctl

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,17 @@ def start_worker(app: str, configfile: str, worker_configfile: str) -> bool:
117117
False if there was an error starting the process
118118
"""
119119

120-
args = [sys.executable, "-B", "-m", app, "-c", configfile, "-c", worker_configfile]
120+
args = [
121+
sys.executable,
122+
"-B",
123+
"-m",
124+
app,
125+
"-c",
126+
configfile,
127+
"-c",
128+
worker_configfile,
129+
"--daemonize",
130+
]
121131

122132
try:
123133
subprocess.check_call(args)
@@ -266,9 +276,6 @@ def main():
266276
worker_cache_factors = (
267277
worker_config.get("synctl_cache_factors") or cache_factors
268278
)
269-
daemonize = worker_config.get("daemonize") or config.get("daemonize")
270-
assert daemonize, "Main process must have daemonize set to true"
271-
272279
# The master process doesn't support using worker_* config.
273280
for key in worker_config:
274281
if key == "worker_app": # But we allow worker_app
@@ -278,11 +285,6 @@ def main():
278285
), "Main process cannot use worker_* config"
279286
else:
280287
worker_pidfile = worker_config["worker_pid_file"]
281-
worker_daemonize = worker_config["worker_daemonize"]
282-
assert worker_daemonize, "In config %r: expected '%s' to be True" % (
283-
worker_configfile,
284-
"worker_daemonize",
285-
)
286288
worker_cache_factor = worker_config.get("synctl_cache_factor")
287289
worker_cache_factors = worker_config.get("synctl_cache_factors", {})
288290
workers.append(

0 commit comments

Comments
 (0)