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:
Ken Tsang
2017-10-10 15:04:55 +01:00
parent 04914d711a
commit dcf0d22d7b
4 changed files with 67 additions and 8 deletions

View File

@@ -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,