mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-11 09:27:56 -04:00
check test environment
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
import os
|
||||||
import uuid
|
import uuid
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
|
|
||||||
@@ -149,16 +150,16 @@ def dao_create_job(job):
|
|||||||
current_app.logger.info(
|
current_app.logger.info(
|
||||||
f"#notify-admin-1859 dao_create_job orig created at {orig_time} and now {now_time}"
|
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(
|
current_app.logger.error(
|
||||||
"#notify-admin-1859 Something is wrong with job.created_at!"
|
"#notify-admin-1859 Something is wrong with job.created_at!"
|
||||||
)
|
)
|
||||||
raise Exception("#notify-admin-1859 Something is wrong with job.created_at!")
|
if os.getenv("NOTIFY_ENVIRONMENT") not in ["test"]:
|
||||||
# job.created_at = now_time
|
job.created_at = now_time
|
||||||
# dao_update_job(job)
|
dao_update_job(job)
|
||||||
# current_app.logger.error(
|
current_app.logger.error(
|
||||||
# f"#notify-admin-1859 Job created_at reset to {job.created_at}"
|
f"#notify-admin-1859 Job created_at reset to {job.created_at}"
|
||||||
# )
|
)
|
||||||
|
|
||||||
|
|
||||||
def dao_update_job(job):
|
def dao_update_job(job):
|
||||||
|
|||||||
Reference in New Issue
Block a user