Skip to content

Commit e527840

Browse files
committed
fixes UnboundLocalError
1 parent 8b73c3f commit e527840

File tree

1 file changed

+5
-4
lines changed
  • services/director-v2/src/simcore_service_director_v2/modules

1 file changed

+5
-4
lines changed

services/director-v2/src/simcore_service_director_v2/modules/dask_client.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,10 @@ async def _get_task_state(job_id: str) -> RunningState:
450450
parsed_event = TaskLifeCycleState.model_validate(dask_events[-1][1])
451451

452452
if parsed_event.state == RunningState.FAILED:
453+
log_error_context = {
454+
"job_id": job_id,
455+
"dask-scheduler": self.backend.scheduler_id,
456+
}
453457
try:
454458
# find out if this was a cancellation
455459
task_future: distributed.Future = (
@@ -461,10 +465,7 @@ async def _get_task_state(job_id: str) -> RunningState:
461465
timeout=_DASK_DEFAULT_TIMEOUT_S
462466
)
463467
assert isinstance(exception, Exception) # nosec
464-
log_error_context = {
465-
"job_id": job_id,
466-
"dask-scheduler": self.backend.scheduler_id,
467-
}
468+
468469
if isinstance(exception, TaskCancelledError):
469470
_logger.info(
470471
**create_troubleshootting_log_kwargs(

0 commit comments

Comments
 (0)