remove unused former send_sms_to_provider and send_sms_to_email functions

they were superceded by deliver_sms and deliver_email in the same file 3 wks ago
This commit is contained in:
Leo Hemsted
2016-10-13 15:53:01 +01:00
parent a095aa41f3
commit a2c3d265de
3 changed files with 10 additions and 178 deletions

View File

@@ -80,51 +80,3 @@ def deliver_email(self, notification_id):
e
)
update_notification_status_by_id(notification_id, 'technical-failure')
@notify_celery.task(bind=True, name="send-sms-to-provider", max_retries=5, default_retry_delay=5)
@statsd(namespace="tasks")
def send_sms_to_provider(self, service_id, notification_id):
# todo: delete this task?
try:
notification = notifications_dao.get_notification_by_id(notification_id)
if not notification:
raise NoResultFound()
send_to_providers.send_sms_to_provider(notification)
except Exception as e:
try:
current_app.logger.error(
"RETRY: SMS notification {} failed".format(notification_id)
)
current_app.logger.exception(e)
self.retry(queue="retry", countdown=retry_iteration_to_delay(self.request.retries))
except self.MaxRetriesExceededError:
current_app.logger.error(
"RETRY FAILED: task send_sms_to_provider failed for notification {}".format(notification_id),
e
)
update_notification_status_by_id(notification_id, 'technical-failure')
@notify_celery.task(bind=True, name="send-email-to-provider", max_retries=5, default_retry_delay=5)
@statsd(namespace="tasks")
def send_email_to_provider(self, service_id, notification_id):
# todo: delete this task?
try:
notification = notifications_dao.get_notification_by_id(notification_id)
if not notification:
raise NoResultFound()
send_to_providers.send_email_to_provider(notification)
except Exception as e:
try:
current_app.logger.error(
"RETRY: Email notification {} failed".format(notification_id)
)
current_app.logger.exception(e)
self.retry(queue="retry", countdown=retry_iteration_to_delay(self.request.retries))
except self.MaxRetriesExceededError:
current_app.logger.error(
"RETRY FAILED: task send_email_to_provider failed for notification {}".format(notification_id),
e
)
update_notification_status_by_id(notification_id, 'technical-failure')