mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-05 02:41:14 -05:00
clean up logs
This commit is contained in:
@@ -157,17 +157,17 @@ def dao_create_job(job):
|
|||||||
orig_time = job.created_at
|
orig_time = job.created_at
|
||||||
now_time = utc_now()
|
now_time = utc_now()
|
||||||
diff_time = now_time - orig_time
|
diff_time = now_time - orig_time
|
||||||
current_app.logger.info(
|
current_app.logger.warning(
|
||||||
f"#notify-debug-admin-1859 dao_create_job orig created at {orig_time} and now {now_time}"
|
f"#notify-debug-admin-1859 dao_create_job orig created at {orig_time} and now {now_time}"
|
||||||
)
|
)
|
||||||
if diff_time.total_seconds() > 300: # 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.warning(
|
||||||
"#notify-debug-admin-1859 Something is wrong with job.created_at!"
|
"#notify-debug-admin-1859 Something is wrong with job.created_at!"
|
||||||
)
|
)
|
||||||
if os.getenv("NOTIFY_ENVIRONMENT") not in ["test"]:
|
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.warning(
|
||||||
f"#notify-debug-admin-1859 Job created_at reset to {job.created_at}"
|
f"#notify-debug-admin-1859 Job created_at reset to {job.created_at}"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -112,17 +112,17 @@ def dao_create_notification(notification):
|
|||||||
except ValueError:
|
except ValueError:
|
||||||
orig_time = datetime.strptime(orig_time, "%Y-%m-%d")
|
orig_time = datetime.strptime(orig_time, "%Y-%m-%d")
|
||||||
diff_time = now_time - orig_time
|
diff_time = now_time - orig_time
|
||||||
current_app.logger.error(
|
current_app.logger.warning(
|
||||||
f"dao_create_notification orig created at: {orig_time} and now created at: {now_time}"
|
f"dao_create_notification orig created at: {orig_time} and now created at: {now_time}"
|
||||||
)
|
)
|
||||||
if diff_time.total_seconds() > 300:
|
if diff_time.total_seconds() > 300:
|
||||||
current_app.logger.error(
|
current_app.logger.warning(
|
||||||
"Something is wrong with notification.created_at in email!"
|
"Something is wrong with notification.created_at in email!"
|
||||||
)
|
)
|
||||||
if os.getenv("NOTIFY_ENVIRONMENT") not in ["test"]:
|
if os.getenv("NOTIFY_ENVIRONMENT") not in ["test"]:
|
||||||
notification.created_at = now_time
|
notification.created_at = now_time
|
||||||
dao_update_notification(notification)
|
dao_update_notification(notification)
|
||||||
current_app.logger.error(
|
current_app.logger.warning(
|
||||||
f"Email notification created_at reset to {notification.created_at}"
|
f"Email notification created_at reset to {notification.created_at}"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user