mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 01:41:05 -05:00
Fix logging in send_sms and send_email
This commit is contained in:
@@ -153,12 +153,12 @@ def send_sms(self,
|
|||||||
)
|
)
|
||||||
|
|
||||||
except SQLAlchemyError as e:
|
except SQLAlchemyError as e:
|
||||||
current_app.logger.exception("RETRY: send_sms notification {}".format(notification_id), e)
|
current_app.logger.exception("RETRY: send_sms notification {}".format(saved_notification.id), e)
|
||||||
try:
|
try:
|
||||||
raise self.retry(queue="retry", exc=e)
|
raise self.retry(queue="retry", exc=e)
|
||||||
except self.MaxRetriesExceededError:
|
except self.MaxRetriesExceededError:
|
||||||
current_app.logger.exception(
|
current_app.logger.exception(
|
||||||
"RETRY FAILED: task send_sms failed for notification {}".format(notification.id),
|
"RETRY FAILED: task send_sms failed for notification {}".format(saved_notification.id),
|
||||||
e
|
e
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -199,13 +199,13 @@ def send_email(self, service_id,
|
|||||||
queue='send-email' if not service.research_mode else 'research-mode'
|
queue='send-email' if not service.research_mode else 'research-mode'
|
||||||
)
|
)
|
||||||
|
|
||||||
current_app.logger.info("Email {} created at {}".format(notification_id, created_at))
|
current_app.logger.info("Email {} created at {}".format(saved_notification.id, created_at))
|
||||||
except SQLAlchemyError as e:
|
except SQLAlchemyError as e:
|
||||||
current_app.logger.exception("RETRY: send_email notification {}".format(notification_id), e)
|
current_app.logger.exception("RETRY: send_email notification {}".format(saved_notification.id), e)
|
||||||
try:
|
try:
|
||||||
raise self.retry(queue="retry", exc=e)
|
raise self.retry(queue="retry", exc=e)
|
||||||
except self.MaxRetriesExceededError:
|
except self.MaxRetriesExceededError:
|
||||||
current_app.logger.error(
|
current_app.logger.error(
|
||||||
"RETRY FAILED: task send_email failed for notification {}".format(notification.id),
|
"RETRY FAILED: task send_email failed for notification {}".format(saved_notification.id),
|
||||||
e
|
e
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user