-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Use aiofiles in static file serving #1404
Comments
Wow such bug. I am one for this needing fixed on the event loop. I guesas it is possible (to bypass it( to have a for loop to check if the loop is closed and if so use So yeah that is another possibility to hack bypass such bug. like one can: def get_event_loop()
""""
Gets an asyncio event loop. And checks to see if it is not closed.
if the loop is closed this handles crating a new event loop.
:returns: asyncio Event loop
"""
loop = asyncio.get_event_loop()
if loop.is_closed():
loop = asyncio.new_event_loop()
return loop That code above is how I personally bypass closed event loops and a |
@AraHaan |
Well unless I use a lib (discord.py) which closes the loop when I dont want it to. Which is the reason I have to hack reopen it as most of the time it goes offline when I cant restart it so it just saves it from not being able to recover from it. |
After a glance on discord.py I see that the library closes loop in If a library closes loop -- drop the library and never use it. Or fix the library first. |
Superseded by #3313 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a [new issue] for related bugs. |
See also #1401
The text was updated successfully, but these errors were encountered: