-
-
Notifications
You must be signed in to change notification settings - Fork 570
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
Bug: hook
函数on_shutdown
在Windows
上无法正常工作
#1654
Comments
补充:
两种情况似乎是随机出现的,但是都没有运行on_shutdown函数 |
hook
函数on_startup
在Windows
上无法正常工作hook
函数on_shutdown
在Windows
上无法正常工作
on_shutdown不会被运行是因为uvicorn的bug至今仍未合并encode/uvicorn#1584 |
|
Can you confirm that PR works for you? Hope my translator is translating right here 😎 👍 |
@shoucandanghehe 测一下 encode/uvicorn#1584 版本的 uvicorn 能否正确运行 shutdown? |
我试了一下 测试代码: @driver.on_startup
async def _():
print("startup")
@driver.on_shutdown
async def _():
print("shutdown")
await asyncio.sleep(3)
print("after sleep") 日志:
|
该问题已在 encode/uvicorn#1584 和 encode/uvicorn#1909 解决 |
Do we need to make a release already, or it can wait? |
This is not a critical issue but this fix will allow developers using windows to test asgi applications correctly, so take your time to release. :) |
描述问题:
被
on_shutdown
装饰的函数 在Windows上 不会在停止bot时 运行如何复现?
on_shutdown
装饰器期望的结果
应用
on_shutdown
装饰器的函数被运行环境信息:
协议端信息:
截图或日志
Windows:
WSL@Ubuntu 22.04.1:
代码示例:
The text was updated successfully, but these errors were encountered: