mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-30 06:21:50 -05:00
check test environment
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user