@@ -341,13 +341,13 @@ def monitor_worker_and_fetch_logs(worker_id) -> None:
341341 analysis .save ()
342342
343343 if not ssh_failed :
344- worker_soft_reset_task (worker .id )
344+ orchestrator .remove_worker (worker )
345+
346+ worker_soft_reset_task (worker .id , True )
345347 process_update_queue (worker )
346348
347- if not worker .status == Worker .ConfigStatus .CONFIGURED :
348- orchestrator .remove_worker (worker )
349- if orchestrator .is_busy (worker ):
350- orchestrator .release_worker (worker )
349+ if worker .status == Worker .ConfigStatus .CONFIGURED :
350+ orchestrator .add_worker (worker )
351351
352352 orchestrator .assign_tasks ()
353353
@@ -600,9 +600,6 @@ def worker_soft_reset_task(worker_id, only_reset=False):
600600 Removes the worker from the orchestrator, reassigns the analysis if needed,
601601 connects via SSH to the worker and performs the soft reset, and re-adds the worker to the orchestrator.
602602
603- Removes the worker from the orchestrator, reassigns the analysis if needed,
604- connects via SSH to the worker and performs the soft reset, and re-adds the worker to the orchestrator.
605-
606603 :param worker_id: ID of worker to soft reset
607604 :param only_reset: If True, only performs the reset without reassigning the analysis or removing the worker from the orchestrator.
608605 """
@@ -658,7 +655,7 @@ def worker_hard_reset_task(worker_id):
658655 orchestrator = get_orchestrator ()
659656 orchestrator .remove_worker (worker , False )
660657
661- worker_soft_reset_task (worker_id )
658+ worker_soft_reset_task (worker_id , True )
662659
663660 ssh_client = None
664661 try :
0 commit comments