We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
版本号:0.2.3.r7.gcc45c4f 运行环境:Arch Linux 问题描述:在 Linux 执行时按 Ctrl+C 无法退出程序。
The text was updated successfully, but these errors were encountered:
OK
Sorry, something went wrong.
学习了一波,原因是dotnet启动过程是,先构建host,然后遍历已注册的所有HostedService,挨个执行StartAsync,全部执行结束后,被视为启动成功。在这之后,Console会监控Ctrl+C事件,触发后会终止应用(HostApplication)。
当前bilibili_tool是利用一个BiliHostedService,在它StartAsync里跑任务,也就是跑完任务才算启动结束(也是bili任务的终止),所以在跑任务过程中没法Ctrl+C退出。
解决方案的话,我想到2个:
打脸了,其实是一直在监控着Ctrl+C的(由ConsoleLifetime),没触发是因为没有传递CancellationToken
Ctrl+C
ConsoleLifetime
CancellationToken
下个版本我来修复
已于v1.0.0发布支持
v1.0.0
No branches or pull requests
版本号:0.2.3.r7.gcc45c4f
运行环境:Arch Linux
问题描述:在 Linux 执行时按 Ctrl+C 无法退出程序。
The text was updated successfully, but these errors were encountered: