Skip to content

Commit 5f16f16

Browse files
committed
Refactor process execution and docs
1 parent e95d834 commit 5f16f16

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

src/pygeoapi_prefect/manager.py

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -95,17 +95,6 @@ class PrefectManager:
9595
enable_async_job_execution: bool
9696
enable_sync_job_execution: bool
9797
supports_subscribing: bool
98-
prefect_state_map = {
99-
StateType.SCHEDULED: JobStatus.accepted,
100-
StateType.PENDING: JobStatus.accepted,
101-
StateType.RUNNING: JobStatus.running,
102-
StateType.COMPLETED: JobStatus.successful,
103-
StateType.FAILED: JobStatus.failed,
104-
StateType.CANCELLED: JobStatus.dismissed,
105-
StateType.CRASHED: JobStatus.failed,
106-
StateType.PAUSED: JobStatus.accepted,
107-
StateType.CANCELLING: JobStatus.dismissed,
108-
}
10998
name: str
11099
# connection: Any = None
111100
# output_dir: Path | None = None
@@ -197,9 +186,7 @@ def get_jobs(
197186
"""
198187
logger.debug(f"get_jobs called with {locals()=}")
199188
if status:
200-
prefect_states = [
201-
k for k, v in self.prefect_state_map.items() if status == v
202-
]
189+
prefect_states = [k for k, v in PREFECT_STATE_MAP.items() if status == v]
203190
else:
204191
prefect_states = [
205192
StateType.RUNNING,

0 commit comments

Comments
 (0)