Skip to content

Commit

Permalink
Moved logging for callback prior to actual call
Browse files Browse the repository at this point in the history
  • Loading branch information
jimleroyer committed Jan 16, 2024
1 parent 91738a7 commit 6bcfc54
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions app/celery/service_callback_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ def send_complaint_to_service(self, complaint_data):
def _send_data_to_service_callback_api(self, data, service_callback_url, token, function_name):
notification_id = data["notification_id"] if "notification_id" in data else data["id"]
try:
current_app.logger.info(
"{} sending {} to {}".format(
function_name,
notification_id,
service_callback_url
)
)
response = request(
method="POST",
url=service_callback_url,
Expand All @@ -69,14 +76,6 @@ def _send_data_to_service_callback_api(self, data, service_callback_url, token,
},
timeout=60,
)
current_app.logger.info(
"{} sending {} to {}, response {}".format(
function_name,
notification_id,
service_callback_url,
response.status_code,
)
)
response.raise_for_status()
except RequestException as e:
current_app.logger.warning(
Expand Down

0 comments on commit 6bcfc54

Please sign in to comment.