diff --git a/backend/app/api/downloads.py b/backend/app/api/downloads.py index ca8fe20..f42cc09 100644 --- a/backend/app/api/downloads.py +++ b/backend/app/api/downloads.py @@ -128,10 +128,12 @@ async def retry_download(download_id: int): if download.status != DownloadStatus.FAILED: return jsonify({"error": "Can only retry failed downloads"}), 400 - # Reset status to queued + # Reset status to queued and clear prior-run timestamps download.status = DownloadStatus.QUEUED download.error_type = None download.error_message = None + download.started_at = None + download.completed_at = None await session.commit() # Queue Celery task to retry the download diff --git a/backend/app/tasks/downloads.py b/backend/app/tasks/downloads.py index 3cdfa87..c3f0b2e 100644 --- a/backend/app/tasks/downloads.py +++ b/backend/app/tasks/downloads.py @@ -265,6 +265,7 @@ async def _download_source_async(source_id: int, download_id: int = None) -> dic download.status = DownloadStatus.RUNNING download.started_at = utcnow() + download.completed_at = None else: logger.warning(f"Download {download_id} not found, creating new record") download = None diff --git a/frontend/src/views/Dashboard.vue b/frontend/src/views/Dashboard.vue index ab65890..8f8d1ed 100644 --- a/frontend/src/views/Dashboard.vue +++ b/frontend/src/views/Dashboard.vue @@ -317,7 +317,7 @@ {{ source.error_count }} - {{ formatDate(source.last_check) }} + {{ source.last_check ? formatRelativeTime(source.last_check) : 'Never' }}