Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(backend-services): use sync Twilio API call in executor #568

Merged
merged 1 commit into from
May 23, 2023

Conversation

billguo99
Copy link
Contributor

Fix did not work:
https://github.com/ntls-io/nautilus-wallet/pull/567/files

From https://www.twilio.com/blog/send-sms-fastapi-twilio:

The problem is that the Twilio helper library for Python does not support asynchronous applications. Since this library will be making network requests to Twilio servers, it will block the loop if used directly in the asynchronous function. To avoid this problem, we’ll encapsulate all the Twilio related work in a function that we’ll call send_sms(), and we’ll execute this function inside an [executor](https://docs.python.org/3/library/asyncio-eventloop.html#executing-code-in-thread-or-process-pools) to keep the async application running smoothly.

From https://www.twilio.com/blog/twilio-python-helper-library-async:
Using Solution #3 - Using a thread executor

@billguo99 billguo99 requested a review from IscoRuta98 May 23, 2023 07:02
@netlify
Copy link

netlify bot commented May 23, 2023

Deploy Preview for nautilus-wallet-staging canceled.

Name Link
🔨 Latest commit ae20671
🔍 Latest deploy log https://app.netlify.com/sites/nautilus-wallet-staging/deploys/646c67b93d057900084a4cc0

@billguo99 billguo99 force-pushed the use-run-in-executor branch from cc95f23 to 372e736 Compare May 23, 2023 07:11
@billguo99 billguo99 force-pushed the use-run-in-executor branch from 372e736 to ae20671 Compare May 23, 2023 07:13
@codecov-commenter
Copy link

Codecov Report

Merging #568 (ae20671) into main (76f7244) will not change coverage.
The diff coverage is n/a.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@           Coverage Diff           @@
##             main     #568   +/-   ##
=======================================
  Coverage   46.92%   46.92%           
=======================================
  Files         173      173           
  Lines        2828     2828           
  Branches      546      546           
=======================================
  Hits         1327     1327           
  Misses       1501     1501           

@billguo99 billguo99 merged commit bb02f6f into main May 23, 2023
@billguo99 billguo99 deleted the use-run-in-executor branch May 23, 2023 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants