Logging where the error is at.

Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
This commit is contained in:
Cliff Hill
2024-07-26 09:46:37 -04:00
parent 8e71edc58d
commit 17b078982f

View File

@@ -51,7 +51,11 @@ def cleanup_unfinished_jobs():
for job in jobs:
# The query already checks that the processing_finished time is null, so here we are saying
# if it started more than 4 hours ago, that's too long
acceptable_finish_time = job.processing_started + timedelta(minutes=5)
try:
acceptable_finish_time = job.processing_started + timedelta(minutes=5)
except TypeError as e:
current_app.logger.error(f"Job ID {job.id} processing_started is {job.processing_started}.")
raise
if now > acceptable_finish_time:
remove_csv_object(job.original_file_name)
dao_archive_job(job)