mljar/mercury

Add check if notebook is still waiting for worker

Opened this issue · 0 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: