From 740a45e19bb7af957bb39e64f7d32e70f7baffe2 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Tue, 20 Aug 2024 12:33:04 -0700 Subject: [PATCH] check test environment --- app/dao/jobs_dao.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) 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):