mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 09:51:11 -05: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:
@@ -19,7 +19,6 @@ from app.celery.scheduled_tasks import (
|
||||
check_job_status,
|
||||
delete_invitations,
|
||||
delete_verify_codes,
|
||||
raise_alert_if_email_sms_still_in_created,
|
||||
remove_yesterdays_planned_tests_on_govuk_alerts,
|
||||
replay_created_notifications,
|
||||
run_scheduled_jobs,
|
||||
@@ -109,24 +108,6 @@ def test_should_update_all_scheduled_jobs_and_put_on_queue(sample_template, mock
|
||||
])
|
||||
|
||||
|
||||
def test_raise_alert_if_email_sms_still_in_created(notify_api, mocker):
|
||||
mock_check = mocker.patch('app.celery.scheduled_tasks.dao_check_notifications_still_in_created')
|
||||
mock_logger = mocker.patch('app.celery.scheduled_tasks.current_app.logger')
|
||||
|
||||
mock_check.return_value = 0
|
||||
raise_alert_if_email_sms_still_in_created()
|
||||
mock_logger.info.assert_called_once_with("0 notifications are still in 'created'.")
|
||||
|
||||
assert mock_check.called_once_with(
|
||||
notify_api.config['CREATED_NOTIFICATIONS_ALERT_AGE']
|
||||
)
|
||||
|
||||
# try again with something to alert about
|
||||
mock_check.return_value = 1
|
||||
raise_alert_if_email_sms_still_in_created()
|
||||
mock_logger.error.assert_called_once_with("1 notifications are still in 'created'.")
|
||||
|
||||
|
||||
@freeze_time('2017-05-01 14:00:00')
|
||||
def test_switch_current_sms_provider_on_slow_delivery_switches_when_one_provider_is_slow(
|
||||
mocker,
|
||||
|
||||
Reference in New Issue
Block a user