fix: capture started_at before clearing in orphaned job reset message

This commit is contained in:
2026-03-18 23:27:23 -04:00
parent 6036c34680
commit c9ac163a4b
+2 -1
View File
@@ -173,9 +173,10 @@ async def _reset_orphaned_running_jobs_async(threshold_minutes: int = None) -> d
reset_count = 0
for job in orphaned_jobs:
original_started_at = job.started_at
job.status = DownloadStatus.QUEUED
job.started_at = None
job.error_message = f"Reset from orphaned running state (was running since {job.started_at})"
job.error_message = f"Reset from orphaned running state (was running since {original_started_at})"
reset_count += 1
logger.info(f"Reset orphaned job {job.id} (URL: {job.url[:50]}...) to QUEUED")