From f5d9f456f28d38c07834cc6b7e75c542cea4d903 Mon Sep 17 00:00:00 2001 From: sanderegg <35365065+sanderegg@users.noreply.github.com> Date: Mon, 2 Dec 2024 14:45:05 +0100 Subject: [PATCH] refactor --- .../simcore_service_director_v2/modules/dask_client.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/services/director-v2/src/simcore_service_director_v2/modules/dask_client.py b/services/director-v2/src/simcore_service_director_v2/modules/dask_client.py index 96505371754..1a1afb69880 100644 --- a/services/director-v2/src/simcore_service_director_v2/modules/dask_client.py +++ b/services/director-v2/src/simcore_service_director_v2/modules/dask_client.py @@ -16,7 +16,7 @@ from copy import deepcopy from dataclasses import dataclass, field from http.client import HTTPException -from typing import Any, cast +from typing import Any, Final, cast import dask.typing import distributed @@ -99,7 +99,7 @@ } -_DASK_DEFAULT_TIMEOUT_S = 1 +_DASK_DEFAULT_TIMEOUT_S: Final[int] = 1 _UserCallbackInSepThread = Callable[[], None] @@ -451,9 +451,9 @@ def _get_pipeline_statuses( ) if dask_status == "erred": # find out if this was a cancellation - exception = await distributed.Future(job_id).exception( - timeout=_DASK_DEFAULT_TIMEOUT_S - ) + exception = await distributed.Future( + job_id, client=self.backend.client + ).exception(timeout=_DASK_DEFAULT_TIMEOUT_S) assert isinstance(exception, Exception) # nosec if isinstance(exception, TaskCancelledError):