From 72bfaf746d17505df01dfa68b23ee43eb9f54144 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Wed, 13 Mar 2019 17:33:54 +0000 Subject: [PATCH] Allow passing --daemonize to workers --- synapse/config/_base.py | 8 +++++++- synapse/config/workers.py | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/synapse/config/_base.py b/synapse/config/_base.py index c4d3087fa4..5613f38e4d 100644 --- a/synapse/config/_base.py +++ b/synapse/config/_base.py @@ -214,14 +214,20 @@ class Config(object): " Defaults to the directory containing the last config file", ) + obj = cls() + + obj.invoke_all("add_arguments", config_parser) + config_args = config_parser.parse_args(argv) config_files = find_config_files(search_paths=config_args.config_path) - obj = cls() obj.read_config_files( config_files, keys_directory=config_args.keys_directory, generate_keys=False ) + + obj.invoke_all("read_arguments", config_args) + return obj @classmethod diff --git a/synapse/config/workers.py b/synapse/config/workers.py index 80baf0ce0e..8dc013d0e8 100644 --- a/synapse/config/workers.py +++ b/synapse/config/workers.py @@ -57,3 +57,7 @@ class WorkerConfig(Config): bind_addresses.append(bind_address) elif not bind_addresses: bind_addresses.append('') + + def read_arguments(self, args): + if args.daemonize is not None: + self.worker_daemonize = args.daemonize