MozillaFoundation / donate-wagtail

[Legacy] - Wagtail based donation stack
Mozilla Public License 2.0
43 stars 22 forks source link

SQS is now first in line, as well as adding a try/except block with error logging #1652

Closed danielfmiranda closed 2 years ago

danielfmiranda commented 2 years ago

Closes #1647 Related PRs/issues #

This PR introduces a try except block, which attempts to use the SQS client's send_message function. If this fails for any reason however, it will print an error, wait 5 seconds, and then try again for a maximum of 3 tries.

I also updated the rearranged the order in which two functions fire, send_to_sqs and process_donation_receipt, as previously if process_donation_receipt failed, send_to_sqs would not fire at all.

Unfortunately due to the github issue we cannot create a review app, but I tried to explain what I did / cite documentation in the comments of the PR.

Please let me know if there are any questions!

danielfmiranda commented 2 years ago

Hi @Pomax thanks for the feedback on this and my other try/except ticket. I have used your feedback from both tickets to update this PR, and have re-requested review.

Thanks!