You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I am using python 3.11 and fastapi.. everything is working as expected but every time the process is exiting (uvicorn web server), i get the following traceback:
Exception ignored in: <function StreamWriter.del at 0x1008cd6c0>
Traceback (most recent call last):
File "/opt/homebrew/Cellar/[email protected]/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/streams.py", line 395, in del
File "/opt/homebrew/Cellar/[email protected]/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/streams.py", line 343, in close
File "/opt/homebrew/Cellar/[email protected]/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/selector_events.py", line 860, in close
File "/opt/homebrew/Cellar/[email protected]/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/base_events.py", line 761, in call_soon
File "/opt/homebrew/Cellar/[email protected]/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/base_events.py", line 519, in _check_closed
RuntimeError: Event loop is closed
I had to add this lines of code inside shutdown to close the connection gracefully which will close the streamwriter related to the connection.
Is this is the right approach? what am I missing?
The text was updated successfully, but these errors were encountered:
@classmethod
async def close(cls):
await cls.redis.close()
This method inside FastAPILimiter does not work because it does not close the connection inside the connection pool.. maybe add the option to add the flag from outside.
So I am using python 3.11 and fastapi.. everything is working as expected but every time the process is exiting (uvicorn web server), i get the following traceback:
Exception ignored in: <function StreamWriter.del at 0x1008cd6c0>
Traceback (most recent call last):
File "/opt/homebrew/Cellar/[email protected]/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/streams.py", line 395, in del
File "/opt/homebrew/Cellar/[email protected]/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/streams.py", line 343, in close
File "/opt/homebrew/Cellar/[email protected]/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/selector_events.py", line 860, in close
File "/opt/homebrew/Cellar/[email protected]/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/base_events.py", line 761, in call_soon
File "/opt/homebrew/Cellar/[email protected]/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/base_events.py", line 519, in _check_closed
RuntimeError: Event loop is closed
I had to add this lines of code inside shutdown to close the connection gracefully which will close the streamwriter related to the connection.
Is this is the right approach? what am I missing?
The text was updated successfully, but these errors were encountered: