-
Notifications
You must be signed in to change notification settings - Fork 2
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
not working with uvloop #3
Comments
@basakest @techoner |
Hi thank you for the contribution. I think based on @chapagainmanoj changes every |
Yes,
adapter = DatabasesAdapter(db_conn)
...
e = casbin.Enforcer(casbin_conf_path, None) # adapter is set to None because it can't awaited in __init__
e.set_adapter(adapter)
if not e.is_filtered():
await e.load_policy() |
@chapagainmanoj plz close this issue if resolved. Also welcome to add an asynccasbin pointer to pycasbin's README |
I tried your solution with threading but it throws me
asyncpg.exceptions._base.InterfaceError: cannot perform operation: another operation is in progress
nest_asyncio doesn't work either even if it works for asyncio loop but with some tradeoffs according to this discussion . So better solution could be rewriting some part of casbin itself to support async, and it seem pretty straight forward and it worked for me with these changes
The text was updated successfully, but these errors were encountered: