Remove redundant @statsd timing decorators

These are superseded by timing task execution generically in the
NotifyTask superclass [1]. Note that we need to wait until we've
gathered enough data under the new metrics before removing these.

[1]: https://github.com/alphagov/notifications-api/pull/3201#pullrequestreview-633549376
This commit is contained in:
Ben Thorner
2021-04-12 15:19:18 +01:00
parent 3e507eea55
commit e3e067c795
10 changed files with 0 additions and 63 deletions

View File

@@ -6,7 +6,6 @@ from botocore.exceptions import ClientError as BotoClientError
from flask import current_app
from notifications_utils.letter_timings import LETTER_PROCESSING_DEADLINE
from notifications_utils.postal_address import PostalAddress
from notifications_utils.statsd_decorators import statsd
from notifications_utils.timezones import convert_utc_to_bst
from app import encryption, notify_celery
@@ -56,7 +55,6 @@ from app.models import (
@notify_celery.task(bind=True, name="get-pdf-for-templated-letter", max_retries=15, default_retry_delay=300)
@statsd(namespace="tasks")
def get_pdf_for_templated_letter(self, notification_id):
try:
notification = get_notification_by_id(notification_id, _raise=True)
@@ -102,7 +100,6 @@ def get_pdf_for_templated_letter(self, notification_id):
@notify_celery.task(bind=True, name="update-billable-units-for-letter", max_retries=15, default_retry_delay=300)
@statsd(namespace="tasks")
def update_billable_units_for_letter(self, notification_id, page_count):
notification = get_notification_by_id(notification_id, _raise=True)
@@ -120,7 +117,6 @@ def update_billable_units_for_letter(self, notification_id, page_count):
@notify_celery.task(name='collate-letter-pdfs-to-be-sent')
@cronitor("collate-letter-pdfs-to-be-sent")
@statsd(namespace="tasks")
def collate_letter_pdfs_to_be_sent():
"""
Finds all letters which are still waiting to be sent to DVLA for printing
@@ -280,7 +276,6 @@ def group_letters(letter_pdfs):
@notify_celery.task(bind=True, name='sanitise-letter', max_retries=15, default_retry_delay=300)
@statsd(namespace="tasks")
def sanitise_letter(self, filename):
try:
reference = get_reference_from_filename(filename)
@@ -319,7 +314,6 @@ def sanitise_letter(self, filename):
@notify_celery.task(bind=True, name='process-sanitised-letter', max_retries=15, default_retry_delay=300)
@statsd(namespace="tasks")
def process_sanitised_letter(self, sanitise_data):
letter_details = encryption.decrypt(sanitise_data)
@@ -433,7 +427,6 @@ def _move_invalid_letter_and_update_status(
@notify_celery.task(name='process-virus-scan-failed')
@statsd(namespace="tasks")
def process_virus_scan_failed(filename):
move_failed_pdf(filename, ScanErrorType.FAILURE)
reference = get_reference_from_filename(filename)
@@ -453,7 +446,6 @@ def process_virus_scan_failed(filename):
@notify_celery.task(name='process-virus-scan-error')
@statsd(namespace="tasks")
def process_virus_scan_error(filename):
move_failed_pdf(filename, ScanErrorType.ERROR)
reference = get_reference_from_filename(filename)