feat(tasks): adopt canonical task statuses
This commit is contained in:
parent
da5aee6e38
commit
38835e9e79
61 changed files with 692 additions and 342 deletions
|
|
@ -17,6 +17,7 @@ from api.services.lifecycle import (
|
|||
transition_task_status,
|
||||
transition_workstream_status,
|
||||
)
|
||||
from api.task_status import TERMINAL_TASK_STATUSES
|
||||
from api.services.reconciliation import (
|
||||
ReconciliationClass,
|
||||
StateChangeClassification,
|
||||
|
|
@ -52,7 +53,7 @@ def _conflict(reason: str, follow_up: str) -> StateChangeClassification:
|
|||
async def _workstream_tasks_terminal(session: AsyncSession, workstream_id: uuid.UUID) -> bool:
|
||||
result = await session.execute(select(Task.status).where(Task.workstream_id == workstream_id))
|
||||
statuses = [status_value(row[0]) for row in result.all()]
|
||||
return bool(statuses) and all(status in {"done", "cancelled"} for status in statuses)
|
||||
return bool(statuses) and all(status in TERMINAL_TASK_STATUSES for status in statuses)
|
||||
|
||||
|
||||
def _deferred_message(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue