fix: capture started_at before clearing in orphaned job reset message
This commit is contained in:
@@ -173,9 +173,10 @@ async def _reset_orphaned_running_jobs_async(threshold_minutes: int = None) -> d
|
|||||||
|
|
||||||
reset_count = 0
|
reset_count = 0
|
||||||
for job in orphaned_jobs:
|
for job in orphaned_jobs:
|
||||||
|
original_started_at = job.started_at
|
||||||
job.status = DownloadStatus.QUEUED
|
job.status = DownloadStatus.QUEUED
|
||||||
job.started_at = None
|
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
|
reset_count += 1
|
||||||
logger.info(f"Reset orphaned job {job.id} (URL: {job.url[:50]}...) to QUEUED")
|
logger.info(f"Reset orphaned job {job.id} (URL: {job.url[:50]}...) to QUEUED")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user