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

Commit ffe6dab

Browse files
committed
Promote mark_filepath to constant
1 parent 4c8ff2e commit ffe6dab

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

docker/configure_workers_and_start.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@
8181
MAIN_PROCESS_UNIX_SOCKET_PUBLIC_PATH = "/run/main_public.sock"
8282
MAIN_PROCESS_UNIX_SOCKET_PRIVATE_PATH = "/run/main_private.sock"
8383

84+
# We place a file at this path to indicate that the script has already been
85+
# run and should not be run again.
86+
MARKER_FILE_PATH = "/conf/workers_have_been_configured"
87+
8488

8589
@dataclass
8690
class WorkerTemplate:
@@ -980,8 +984,8 @@ def main(args: List[str], environ: MutableMapping[str, str]) -> None:
980984
log("Base homeserver config exists—not regenerating")
981985
# This script may be run multiple times (mostly by Complement, see note at top of
982986
# file). Don't re-configure workers in this instance.
983-
mark_filepath = "/conf/workers_have_been_configured"
984-
if not os.path.exists(mark_filepath):
987+
988+
if not os.path.exists(MARKER_FILE_PATH):
985989
# Collect and validate worker_type requests
986990
# Read the desired worker configuration from the environment
987991
worker_types_env = environ.get("SYNAPSE_WORKER_TYPES", "").strip()
@@ -1000,7 +1004,7 @@ def main(args: List[str], environ: MutableMapping[str, str]) -> None:
10001004
generate_worker_files(environ, config_path, data_dir, requested_worker_types)
10011005

10021006
# Mark workers as being configured
1003-
with open(mark_filepath, "w") as f:
1007+
with open(MARKER_FILE_PATH, "w") as f:
10041008
f.write("")
10051009
else:
10061010
log("Worker config exists—not regenerating")

0 commit comments

Comments
 (0)