Skip to content

Commit 4bc004e

Browse files
author
Andrei Neagu
committed
refactor
1 parent 95be4ab commit 4bc004e

File tree

1 file changed

+9
-8
lines changed
  • services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/services/generic_scheduler

1 file changed

+9
-8
lines changed

services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/services/generic_scheduler/_core_utils.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,25 @@
3434
Store,
3535
)
3636

37-
PARALLEL_STATUS_REQUESTS: Final[NonNegativeInt] = 5
38-
3937
_logger = logging.getLogger(__name__)
4038

4139

40+
PARALLEL_STATUS_REQUESTS: Final[NonNegativeInt] = 5
41+
42+
4243
_IN_PROGRESS_STATUSES: Final[set[StepStatus]] = {
4344
StepStatus.SCHEDULED,
4445
StepStatus.CREATED,
4546
StepStatus.RUNNING,
4647
}
4748

4849

50+
def is_operation_in_progress_status(
51+
steps_statuses: dict[StepName, StepStatus],
52+
) -> bool:
53+
return any(status in _IN_PROGRESS_STATUSES for status in steps_statuses.values())
54+
55+
4956
async def _get_step_status(step_proxy: StepStoreProxy) -> tuple[StepName, StepStatus]:
5057
try:
5158
status = await step_proxy.get("status")
@@ -65,12 +72,6 @@ async def get_steps_statuses(
6572
return dict(result)
6673

6774

68-
def is_operation_in_progress_status(
69-
steps_statuses: dict[StepName, StepStatus],
70-
) -> bool:
71-
return any(status in _IN_PROGRESS_STATUSES for status in steps_statuses.values())
72-
73-
7475
async def start_and_mark_as_started(
7576
step_proxy: StepStoreProxy,
7677
*,

0 commit comments

Comments
 (0)