mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-31 23:26:23 -05:00
Record providers we time out notifications for
This will help us monitor issues with delivery receipts and keep track of provider performance over time. I'm not concerned about performance here: - The number of notifications to time out is usually small. - This task only runs once a day. - Calls to StatsD are quick and cheap.
This commit is contained in:
@@ -8,7 +8,7 @@ from notifications_utils.clients.zendesk.zendesk_client import (
|
|||||||
from sqlalchemy import func
|
from sqlalchemy import func
|
||||||
from sqlalchemy.exc import SQLAlchemyError
|
from sqlalchemy.exc import SQLAlchemyError
|
||||||
|
|
||||||
from app import notify_celery, zendesk_client
|
from app import notify_celery, statsd_client, zendesk_client
|
||||||
from app.aws import s3
|
from app.aws import s3
|
||||||
from app.config import QueueNames
|
from app.config import QueueNames
|
||||||
from app.cronitor import cronitor
|
from app.cronitor import cronitor
|
||||||
@@ -123,6 +123,7 @@ def timeout_notifications():
|
|||||||
notifications = dao_timeout_notifications(cutoff_time)
|
notifications = dao_timeout_notifications(cutoff_time)
|
||||||
|
|
||||||
for notification in notifications:
|
for notification in notifications:
|
||||||
|
statsd_client.incr(f'timeout-sending.{notification.sent_by}')
|
||||||
check_and_queue_callback_task(notification)
|
check_and_queue_callback_task(notification)
|
||||||
|
|
||||||
current_app.logger.info(
|
current_app.logger.info(
|
||||||
|
|||||||
Reference in New Issue
Block a user