File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
services/storage/src/simcore_service_storage Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ async def get_status(
4444 return AsyncJobStatus (
4545 job_id = job_id ,
4646 progress = task_status .progress_report ,
47- done = False ,
47+ done = task_status . is_done ,
4848 )
4949
5050
Original file line number Diff line number Diff line change @@ -21,11 +21,18 @@ class TaskState(StrEnum):
2121 ABORTED = auto ()
2222
2323
24+ _TASK_DONE = {TaskState .SUCCESS , TaskState .FAILURE , TaskState .ABORTED }
25+
26+
2427class TaskStatus (BaseModel ):
2528 task_uuid : TaskUUID
2629 task_state : TaskState
2730 progress_report : ProgressReport
2831
32+ @property
33+ def is_done (self ) -> bool :
34+ return self .task_state in _TASK_DONE
35+
2936 @model_validator (mode = "after" )
3037 def _check_consistency (self ) -> Self :
3138 value = self .progress_report .actual_value
You can’t perform that action at this time.
0 commit comments