mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-17 02:32:32 -05:00
Updates as per review comments
This commit is contained in:
@@ -411,8 +411,9 @@ def send_inbound_sms_to_service(self, inbound_sms_id, service_id):
|
|||||||
current_app.logger.exception("Exception raised in send_inbound_sms_to_service for service_id: {} and url: {}. "
|
current_app.logger.exception("Exception raised in send_inbound_sms_to_service for service_id: {} and url: {}. "
|
||||||
"\n{}".format(service_id, inbound_api.url, e))
|
"\n{}".format(service_id, inbound_api.url, e))
|
||||||
if e.response.status_code >= 500:
|
if e.response.status_code >= 500:
|
||||||
self.retry(queue=QueueNames.RETRY,
|
try:
|
||||||
exc='Unable to send_inbound_sms_to_service for service_id: {} and url: {}. \n{}'.format(
|
self.retry(queue=QueueNames.RETRY,
|
||||||
service_id, inbound_api.url, e))
|
exc='Unable to send_inbound_sms_to_service for service_id: {} and url: {}. \n{}'.format(
|
||||||
except self.MaxRetriesExceededError:
|
service_id, inbound_api.url, e))
|
||||||
current_app.logger.exception('Retry: send_inbound_sms_to_service has retried the max number of times')
|
except self.MaxRetriesExceededError:
|
||||||
|
current_app.logger.exception('Retry: send_inbound_sms_to_service has retried the max number of times')
|
||||||
|
|||||||
@@ -50,7 +50,8 @@ def receive_mmg_sms():
|
|||||||
provider_name="mmg")
|
provider_name="mmg")
|
||||||
|
|
||||||
tasks.send_inbound_sms_to_service.apply_async([str(inbound.id), str(service.id)], queue=QueueNames.NOTIFY)
|
tasks.send_inbound_sms_to_service.apply_async([str(inbound.id), str(service.id)], queue=QueueNames.NOTIFY)
|
||||||
current_app.logger.info('{} received inbound SMS with reference {}'.format(service.id, inbound.provider_reference))
|
current_app.logger.info(
|
||||||
|
'{} received inbound SMS with reference {} from MMG'.format(service.id, inbound.provider_reference))
|
||||||
|
|
||||||
return 'RECEIVED', 200
|
return 'RECEIVED', 200
|
||||||
|
|
||||||
@@ -79,7 +80,8 @@ def receive_firetext_sms():
|
|||||||
statsd_client.incr('inbound.firetext.successful')
|
statsd_client.incr('inbound.firetext.successful')
|
||||||
|
|
||||||
tasks.send_inbound_sms_to_service.apply_async([str(inbound.id), str(service.id)], queue=QueueNames.NOTIFY)
|
tasks.send_inbound_sms_to_service.apply_async([str(inbound.id), str(service.id)], queue=QueueNames.NOTIFY)
|
||||||
|
current_app.logger.info(
|
||||||
|
'{} received inbound SMS with reference {} from Firetext'.format(service.id, inbound.provider_reference))
|
||||||
return jsonify({
|
return jsonify({
|
||||||
"status": "ok"
|
"status": "ok"
|
||||||
}), 200
|
}), 200
|
||||||
|
|||||||
Reference in New Issue
Block a user