mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-20 22:39:43 -04:00
Compare commits
1 Commits
main
...
log-provid
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bea8da5560 |
@@ -24,7 +24,7 @@ def deliver_sms(self, notification_id):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
if isinstance(e, SmsClientResponseException):
|
if isinstance(e, SmsClientResponseException):
|
||||||
current_app.logger.warning(
|
current_app.logger.warning(
|
||||||
"SMS notification delivery for id: {} failed".format(notification_id)
|
"SMS notification delivery for id: {} failed due to {}".format(notification_id, e)
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
current_app.logger.exception(
|
current_app.logger.exception(
|
||||||
|
|||||||
@@ -82,7 +82,12 @@ def send_sms_to_provider(notification):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
notification.billable_units = template.fragment_count
|
notification.billable_units = template.fragment_count
|
||||||
dao_update_notification(notification)
|
dao_update_notification(notification)
|
||||||
dao_reduce_sms_provider_priority(provider.get_name(), time_threshold=timedelta(minutes=1))
|
|
||||||
|
provider_name = provider.get_name()
|
||||||
|
current_app.logger.info(
|
||||||
|
"Reducing priority for {provider_name} due to exception raised when calling provider API"
|
||||||
|
)
|
||||||
|
dao_reduce_sms_provider_priority(provider_name, time_threshold=timedelta(minutes=1))
|
||||||
raise e
|
raise e
|
||||||
else:
|
else:
|
||||||
notification.billable_units = template.fragment_count
|
notification.billable_units = template.fragment_count
|
||||||
|
|||||||
Reference in New Issue
Block a user