fix minor startup error

This commit is contained in:
Kenneth Kehl
2025-02-03 10:40:55 -08:00
parent 0226c072f4
commit 3d6f112324
2 changed files with 14 additions and 18 deletions

View File

@@ -52,7 +52,8 @@ def cleanup_unfinished_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
try:
acceptable_finish_time = job.processing_started + timedelta(minutes=5)
if job.processing_started is not None:
acceptable_finish_time = job.processing_started + timedelta(minutes=5)
except TypeError:
current_app.logger.exception(
f"Job ID {job.id} processing_started is {job.processing_started}.",