8181MAIN_PROCESS_UNIX_SOCKET_PUBLIC_PATH = "/run/main_public.sock"
8282MAIN_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
8690class WorkerTemplate :
@@ -981,8 +985,8 @@ def main(args: List[str], environ: MutableMapping[str, str]) -> None:
981985 log ("Base homeserver config exists—not regenerating" )
982986 # This script may be run multiple times (mostly by Complement, see note at top of
983987 # file). Don't re-configure workers in this instance.
984- mark_filepath = "/conf/workers_have_been_configured"
985- if not os .path .exists (mark_filepath ):
988+
989+ if not os .path .exists (MARKER_FILE_PATH ):
986990 # Collect and validate worker_type requests
987991 # Read the desired worker configuration from the environment
988992 worker_types_env = environ .get ("SYNAPSE_WORKER_TYPES" , "" ).strip ()
@@ -1001,7 +1005,7 @@ def main(args: List[str], environ: MutableMapping[str, str]) -> None:
10011005 generate_worker_files (environ , config_path , data_dir , requested_worker_types )
10021006
10031007 # Mark workers as being configured
1004- with open (mark_filepath , "w" ) as f :
1008+ with open (MARKER_FILE_PATH , "w" ) as f :
10051009 f .write ("" )
10061010 else :
10071011 log ("Worker config exists—not regenerating" )
0 commit comments