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

async calls to database do not work #445

Closed
wpmjones opened this issue Aug 2, 2019 · 1 comment
Closed

async calls to database do not work #445

wpmjones opened this issue Aug 2, 2019 · 1 comment

Comments

@wpmjones
Copy link

wpmjones commented Aug 2, 2019

Maybe I'm not doing something right, but I'm using asyncpg to connect to my postgresql database which houses my users. The user_loader is synchronous. I have tried using loop.run_until_complete but I get one of the following errors:
Cannot run the event loop while another loop is running
RuntimeWarning: coroutine 'User.get' was never awaited

Am I trying to do something that just isn't possible with this package or am I missing a step somewhere?

Code at:
https://github.com/wpmjones/studtext/blob/master/temp.py

@davidism
Copy link
Collaborator

davidism commented Aug 2, 2019

Flask does not yet support ASGI. That's required before any extensions can think about support for async, at which point every extension will still need to be written to support async. If you're interested in adding ASGI support, see pallets/werkzeug#1322.

@davidism davidism closed this as completed Aug 2, 2019
Repository owner deleted a comment from pgjones Mar 19, 2020
Repository owner locked and limited conversation to collaborators Mar 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants