Merge pull request #318 from alphagov/tech-failures

New notification status types
This commit is contained in:
Rebecca Law
2016-05-17 13:50:57 +01:00
4 changed files with 61 additions and 9 deletions

View File

@@ -86,6 +86,9 @@ def delete_failed_notifications():
try:
start = datetime.utcnow()
deleted = delete_notifications_created_more_than_a_week_ago('failed')
deleted += delete_notifications_created_more_than_a_week_ago('technical-failure')
deleted += delete_notifications_created_more_than_a_week_ago('temporary-failure')
deleted += delete_notifications_created_more_than_a_week_ago('permanent-failure')
current_app.logger.info(
"Delete job started {} finished {} deleted {} failed notifications".format(
start,
@@ -268,7 +271,7 @@ def send_sms(service_id, notification_id, encrypted_notification, created_at):
"SMS notification {} failed".format(notification_id)
)
current_app.logger.exception(e)
notification_db_object.status = 'failed'
notification_db_object.status = 'technical-failure'
dao_update_notification(notification_db_object)
current_app.logger.info(
@@ -338,7 +341,7 @@ def send_email(service_id, notification_id, from_address, encrypted_notification
except EmailClientException as e:
current_app.logger.exception(e)
notification_db_object.status = 'failed'
notification_db_object.status = 'technical-failure'
dao_update_notification(notification_db_object)
current_app.logger.info(