mljar / mercury

Convert Jupyter Notebooks to Web Apps

Home Page:https://RunMercury.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add check if notebook is still waiting for worker

pplonski opened this issue · comments

Please check if session is still waiting for worker before spinning new worker. I think fix code should be here

notebook_id = job_params["notebook_id"]
session_id = job_params["session_id"]
worker_id = job_params["worker_id"]
worker_url = f"http://{worker_ip}/start/{notebook_id}/{session_id}/{worker_id}"
log.info(f"Try to start worker {worker_url}")
response = requests.get(worker_url, timeout=5)
log.info(f"Response from worker {response.status_code}")
if response.status_code == 200: