mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-16 18:22:17 -05:00
Logging where the error is at.
Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user