diff options
author | Olivier Wilkinson (reivilibre) <oliverw@matrix.org> | 2022-05-27 13:23:51 +0100 |
---|---|---|
committer | Olivier Wilkinson (reivilibre) <oliverw@matrix.org> | 2022-05-27 14:31:51 +0100 |
commit | 54f3c50826cf997e9652fa3eacc3fd787bdcd8de (patch) | |
tree | 6fcdeb4bfc7bf4b4a36840a164c3963da49d30f5 | |
parent | Newsfile (diff) | |
download | synapse-54f3c50826cf997e9652fa3eacc3fd787bdcd8de.tar.xz |
lints
-rwxr-xr-x | docker/configure_workers_and_start.py | 3 | ||||
-rw-r--r-- | synapse/app/_complement_fork_starter.py | 20 |
2 files changed, 18 insertions, 5 deletions
diff --git a/docker/configure_workers_and_start.py b/docker/configure_workers_and_start.py index 9dbdd8f38b..75438316d9 100755 --- a/docker/configure_workers_and_start.py +++ b/docker/configure_workers_and_start.py @@ -405,7 +405,6 @@ def generate_worker_files( # For each worker type specified by the user, create config values for worker_type in worker_types: - startup_config: Dict[str, Any] = {} worker_type = worker_type.strip() worker_config = WORKERS_CONFIG.get(worker_type) @@ -535,7 +534,7 @@ def generate_worker_files( "/conf/supervisord.conf.j2", "/etc/supervisor/supervisord.conf", main_config_path=config_path, - #worker_config=supervisord_config, + # worker_config=supervisord_config, worker_config="", ) diff --git a/synapse/app/_complement_fork_starter.py b/synapse/app/_complement_fork_starter.py index 9cdb819394..57cfef440b 100644 --- a/synapse/app/_complement_fork_starter.py +++ b/synapse/app/_complement_fork_starter.py @@ -31,7 +31,7 @@ import sys # synapse.app.generic_worker [args..] -- \ # ... # synapse.app.generic_worker [args..] -from typing import Callable, List, Any +from typing import Any, Callable, List from twisted.internet.main import installReactor @@ -54,10 +54,13 @@ class ProxiedReactor: return getattr(self.___reactor_target, attr_name) -def _worker_entrypoint(func: Callable[[], None], proxy_reactor: ProxiedReactor, args: List[str]) -> None: +def _worker_entrypoint( + func: Callable[[], None], proxy_reactor: ProxiedReactor, args: List[str] +) -> None: sys.argv = args from twisted.internet.epollreactor import EPollReactor + proxy_reactor.___install(EPollReactor()) func() @@ -98,8 +101,19 @@ def main() -> None: # try to create a schema version table and some will crash out. # HACK from synapse._scripts import update_synapse_database + update_proc = multiprocessing.Process( - target=_worker_entrypoint, args=(update_synapse_database.main, proxy_reactor, ["update_synapse_database", "--database-config", db_config_path, "--run-background-updates"]) + target=_worker_entrypoint, + args=( + update_synapse_database.main, + proxy_reactor, + [ + "update_synapse_database", + "--database-config", + db_config_path, + "--run-background-updates", + ], + ), ) print("===== PREPARING DATABASE =====", file=sys.stderr) update_proc.start() |