mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-16 20:48:37 -04:00
Remove alert for email / sms in created
In response to [1]. [1]: https://github.com/alphagov/notifications-api/pull/3383#discussion_r759379988 It turns out the code that inspired this new alert - in the old "timeout-sending-notifications" task - was actually redundant as we already have a task to "replay" notifications still in "created", which is much better than just alerting about them. It's possible the replayed notifications will also fail, but in both cases we should see some kind of error due to this, so I don't think we're losing anything by not having an alert.
This commit is contained in:
@@ -30,7 +30,6 @@ from app.dao.jobs_dao import (
|
||||
find_missing_row_for_job,
|
||||
)
|
||||
from app.dao.notifications_dao import (
|
||||
dao_check_notifications_still_in_created,
|
||||
dao_old_letters_with_created_status,
|
||||
dao_precompiled_letters_still_pending_virus_check,
|
||||
is_delivery_slow_for_providers,
|
||||
@@ -119,19 +118,6 @@ def switch_current_sms_provider_on_slow_delivery():
|
||||
dao_reduce_sms_provider_priority(provider_name, time_threshold=timedelta(minutes=10))
|
||||
|
||||
|
||||
@notify_celery.task(name='raise-alert-if-email-sms-still-in-created')
|
||||
def raise_alert_if_email_sms_still_in_created():
|
||||
alert_above_age = current_app.config.get('CREATED_NOTIFICATIONS_ALERT_AGE')
|
||||
still_in_created = dao_check_notifications_still_in_created(alert_above_age)
|
||||
message = f"{still_in_created} notifications are still in 'created'."
|
||||
|
||||
if still_in_created == 0:
|
||||
current_app.logger.info(message)
|
||||
return
|
||||
|
||||
current_app.logger.error(message)
|
||||
|
||||
|
||||
@notify_celery.task(name='tend-providers-back-to-middle')
|
||||
def tend_providers_back_to_middle():
|
||||
dao_adjust_provider_priority_back_to_resting_points()
|
||||
|
||||
Reference in New Issue
Block a user