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

check for already set asyncio event loop policy #1637

Merged
merged 2 commits into from
Aug 28, 2019
Merged

check for already set asyncio event loop policy #1637

merged 2 commits into from
Aug 28, 2019

Conversation

syfluqs
Copy link
Contributor

@syfluqs syfluqs commented Jul 20, 2019

For projects using app.create_server instead of app.run, if event loop policy is already set to uvloops policy externally, sanic will reset it and may cause two asyncio event loops to spawn, one from the earlier policy and one with the policy set by sanic.

This patch will check if asyncio event loop policy is already set as uvloop policy and won't reset it, if so.

Copy link
Member

@ahopkins ahopkins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks okay. Just take a look at the linting issue and fix.

sanic/server.py:32:1: W293 blank line contains whitespace

@codecov
Copy link

codecov bot commented Aug 11, 2019

Codecov Report

Merging #1637 into master will increase coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1637      +/-   ##
==========================================
+ Coverage   91.61%   91.61%   +<.01%     
==========================================
  Files          19       20       +1     
  Lines        2099     2100       +1     
  Branches      391      391              
==========================================
+ Hits         1923     1924       +1     
  Misses        138      138              
  Partials       38       38
Impacted Files Coverage Δ
sanic/request.py 97.58% <0%> (ø) ⬆️
sanic/app.py 92.67% <0%> (ø) ⬆️
sanic/__init__.py 100% <0%> (ø) ⬆️
sanic/blueprint_group.py 100% <0%> (ø) ⬆️
sanic/__version__.py 100% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 84b4112...b76bc73. Read the comment docs.

@sjsadowski sjsadowski merged commit ae91852 into sanic-org:master Aug 28, 2019
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.

4 participants