From eb1cf02ddfc6793dec66bbeda1e201babb5b030b Mon Sep 17 00:00:00 2001 From: Kapil Yedidi Date: Wed, 20 Mar 2024 17:37:01 -0700 Subject: [PATCH] Allow for a custom task server URL --- mercury/apps/ws/tasks.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mercury/apps/ws/tasks.py b/mercury/apps/ws/tasks.py index e5b5408..34fe2c8 100644 --- a/mercury/apps/ws/tasks.py +++ b/mercury/apps/ws/tasks.py @@ -20,6 +20,7 @@ log = logging.getLogger(__name__) +CUSTOM_TASK_SERVER_URL = os.getenv("MERCURY_TASK_SERVER_URL") @shared_task(bind=True) def task_start_websocket_worker(self, job_params): @@ -42,7 +43,7 @@ def task_start_websocket_worker(self, job_params): str(job_params["notebook_id"]), str(job_params["session_id"]), str(job_params["worker_id"]), - job_params["server_url"], + CUSTOM_TASK_SERVER_URL or job_params["server_url"], ] log.info("Start " + " ".join(command)) worker = subprocess.Popen(command) @@ -77,4 +78,4 @@ def task_start_websocket_worker(self, job_params): log.info("Defer task start ws worker") need_instance(job_params["worker_id"]) task_start_websocket_worker.s(job_params).apply_async(countdown=5) - \ No newline at end of file +