mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-26 04:21:52 -05:00
Added alert when job.notification_count doesn't match total notification for job
- Added log for when a job starts so that we will know when the processing of a job starts with the number of notifications - Added dao method to get total notifications for a job id - Added a test to check whether the number of notifications in the table matches the job notification_count
This commit is contained in:
@@ -442,6 +442,16 @@ def get_total_sent_notifications_in_date_range(start_date, end_date, notificatio
|
||||
return result or 0
|
||||
|
||||
|
||||
def dao_get_total_notifications_for_job_id(job_id):
|
||||
result = db.session.query(
|
||||
func.count(Notification.id).label('count')
|
||||
).filter(
|
||||
Notification.job_id == job_id
|
||||
).scalar()
|
||||
|
||||
return result or 0
|
||||
|
||||
|
||||
def is_delivery_slow_for_provider(
|
||||
sent_at,
|
||||
provider,
|
||||
|
||||
Reference in New Issue
Block a user