From b18162135f1bf4a2122fcf4963a53f9c13a0205c Mon Sep 17 00:00:00 2001 From: Mike Lang Date: Mon, 13 May 2019 03:06:51 -0700 Subject: [PATCH] downloader: Start backdoor later so workers is in locals --- downloader/downloader/main.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/downloader/downloader/main.py b/downloader/downloader/main.py index 0879398..5b513d6 100644 --- a/downloader/downloader/main.py +++ b/downloader/downloader/main.py @@ -563,12 +563,13 @@ def main(channels, base_dir=".", qualities="source", metrics_port=8001, backdoor common.install_stacksampler() prom.start_http_server(metrics_port) - if backdoor_port: - gevent.backdoor.BackdoorServer(('127.0.0.1', backdoor_port), locals=locals()).start() - logging.info("Starting up") workers = [gevent.spawn(manager.run) for manager in managers] + + if backdoor_port: + gevent.backdoor.BackdoorServer(('127.0.0.1', backdoor_port), locals=locals()).start() + # Wait for any to die gevent.wait(workers, count=1) # If one has stopped, either: