diff --git a/app/dao/jobs_dao.py b/app/dao/jobs_dao.py index ffa55d82f..81db8f19f 100644 --- a/app/dao/jobs_dao.py +++ b/app/dao/jobs_dao.py @@ -1,3 +1,4 @@ +import os import uuid from datetime import timedelta @@ -149,16 +150,16 @@ def dao_create_job(job): current_app.logger.info( f"#notify-admin-1859 dao_create_job orig created at {orig_time} and now {now_time}" ) - if diff_time.total_seconds() > 120: # It should be only a few seconds diff at most + if diff_time.total_seconds() > 300: # It should be only a few seconds diff at most current_app.logger.error( "#notify-admin-1859 Something is wrong with job.created_at!" ) - raise Exception("#notify-admin-1859 Something is wrong with job.created_at!") - # job.created_at = now_time - # dao_update_job(job) - # current_app.logger.error( - # f"#notify-admin-1859 Job created_at reset to {job.created_at}" - # ) + if os.getenv("NOTIFY_ENVIRONMENT") not in ["test"]: + job.created_at = now_time + dao_update_job(job) + current_app.logger.error( + f"#notify-admin-1859 Job created_at reset to {job.created_at}" + ) def dao_update_job(job):