mirror of
https://github.com/GSA/notifications-api.git
synced 2026-07-16 11:20:41 -04:00
Removed statsd from the api and use the statsd in the utils library.
The statsd code was added to the utils library a while ago, uses the statsd from the util library and therefore consolidates the code into once place.
This commit is contained in:
@@ -2,6 +2,7 @@ from datetime import datetime, timedelta
|
||||
import math
|
||||
|
||||
from flask import current_app
|
||||
from notifications_utils.statsd_decorators import statsd
|
||||
from requests import (
|
||||
post as requests_post,
|
||||
RequestException
|
||||
@@ -20,7 +21,6 @@ from app.dao.notifications_dao import (
|
||||
dao_get_notifications_by_references,
|
||||
)
|
||||
from app.models import NOTIFICATION_CREATED
|
||||
from app.statsd_decorators import statsd
|
||||
|
||||
LETTERS_PDF_FILE_LOCATION_STRUCTURE = \
|
||||
'{folder}/NOTIFY.{reference}.{duplex}.{letter_class}.{colour}.{crown}.{date}.pdf'
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
from flask import current_app
|
||||
from notifications_utils.statsd_decorators import statsd
|
||||
|
||||
from app import notify_celery
|
||||
from app.config import QueueNames
|
||||
from app.statsd_decorators import statsd
|
||||
|
||||
from app.notifications.notifications_ses_callback import process_ses_response
|
||||
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
from celery.signals import worker_process_shutdown
|
||||
from flask import current_app
|
||||
from notifications_utils.recipients import InvalidEmailError
|
||||
from notifications_utils.statsd_decorators import statsd
|
||||
from sqlalchemy.orm.exc import NoResultFound
|
||||
|
||||
from app import notify_celery
|
||||
from app.config import QueueNames
|
||||
from app.dao import notifications_dao
|
||||
from app.dao.notifications_dao import update_notification_status_by_id
|
||||
from app.statsd_decorators import statsd
|
||||
from app.delivery import send_to_providers
|
||||
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ from datetime import (
|
||||
|
||||
from celery.signals import worker_process_shutdown
|
||||
from flask import current_app
|
||||
from notifications_utils.statsd_decorators import statsd
|
||||
from sqlalchemy import and_
|
||||
from sqlalchemy.exc import SQLAlchemyError
|
||||
from notifications_utils.s3 import s3upload
|
||||
@@ -54,7 +55,6 @@ from app.models import (
|
||||
JOB_STATUS_READY_TO_SEND
|
||||
)
|
||||
from app.notifications.process_notifications import send_notification_to_queue
|
||||
from app.statsd_decorators import statsd
|
||||
from app.celery.tasks import (
|
||||
create_dvla_file_contents_for_notifications,
|
||||
process_job
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
import json
|
||||
|
||||
from notifications_utils.statsd_decorators import statsd
|
||||
|
||||
from app import (
|
||||
DATETIME_FORMAT,
|
||||
notify_celery,
|
||||
@@ -7,7 +10,6 @@ from app.dao.notifications_dao import (
|
||||
get_notification_by_id,
|
||||
)
|
||||
|
||||
from app.statsd_decorators import statsd
|
||||
from app.dao.service_callback_api_dao import get_service_callback_api_for_service
|
||||
from requests import (
|
||||
HTTPError,
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
from celery.signals import worker_process_shutdown
|
||||
from notifications_utils.statsd_decorators import statsd
|
||||
from sqlalchemy.exc import SQLAlchemyError
|
||||
|
||||
from app import notify_celery
|
||||
from flask import current_app
|
||||
|
||||
from app.statsd_decorators import statsd
|
||||
from app.dao.statistics_dao import (
|
||||
create_or_update_job_sending_statistics,
|
||||
update_job_stats_outcome_count
|
||||
|
||||
@@ -8,6 +8,7 @@ from flask import current_app
|
||||
from notifications_utils.recipients import (
|
||||
RecipientCSV
|
||||
)
|
||||
from notifications_utils.statsd_decorators import statsd
|
||||
from notifications_utils.template import (
|
||||
SMSMessageTemplate,
|
||||
WithSubjectTemplate,
|
||||
@@ -71,7 +72,6 @@ from app.models import (
|
||||
)
|
||||
from app.notifications.process_notifications import persist_notification
|
||||
from app.service.utils import service_allowed_to_send_to
|
||||
from app.statsd_decorators import statsd
|
||||
from notifications_utils.s3 import s3upload
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user