check test environment

This commit is contained in:
Kenneth Kehl
2024-08-20 12:33:04 -07:00
parent 74fb6b0301
commit 740a45e19b

View File

@@ -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):