Restore supervision task status back to pending after a failed execution.
(task_id: uuid.UUID)
| 155 | |
| 156 | |
| 157 | async def _restore_supervision_status(task_id: uuid.UUID) -> None: |
| 158 | """Restore supervision task status back to pending after a failed execution.""" |
| 159 | async with async_session() as db: |
| 160 | result = await db.execute(select(Task).where(Task.id == task_id)) |
| 161 | task = result.scalar_one_or_none() |
| 162 | if task and task.status == "doing": |
| 163 | task.status = "pending" |
| 164 | await db.commit() |
no test coverage detected