Refine datasource trigger flow and CLI output

This commit is contained in:
rayd1o
2026-04-08 03:22:08 +08:00
parent f5308340af
commit da587398d9
3 changed files with 158 additions and 83 deletions

View File

@@ -282,6 +282,7 @@ class BaseCollector(ABC):
"execution_time_seconds": (datetime.now(UTC) - start_time).total_seconds(),
}
except asyncio.CancelledError:
await db.rollback()
task.status = "cancelled"
task.phase = "cancelled"
task.error_message = "Collection cancelled by operator and rolled back"
@@ -297,6 +298,7 @@ class BaseCollector(ABC):
await self._publish_task_update(force=True)
raise
except Exception as e:
await db.rollback()
task.status = "failed"
task.phase = "failed"
task.error_message = str(e)