热重载监督者优雅响应 Ctrl+C:先等子进程收尾再回收
- run_supervisor 捕获 KeyboardInterrupt:不打 traceback、退出码归零, 给子进程 _GRACE_SECONDS=5s 自行收尾窗口(打退出日志、关连接), 超时才 taskkill /F /T;文件变更重启仍立即强杀(子进程不知情不会自己退) - main() 兜底监督循环间隙的 Ctrl+C - start.bat 改为发射器:start 新开独立控制台跑 cmd /c 命令行(非批 处理),Ctrl+C 直接停进程,规避「终止批处理操作吗(Y/N)」,发射器 即退;bat 保持纯 ASCII 防 GBK 乱码
This commit is contained in:
1 parent
6b6492dc8d
commit
d71809d144
3 files changed
+33
-5
No files matched your search
@@ -1 +1,5 @@
|
||||
uv run musicbot --reload
|
||||
@echo off
|
||||
rem Run the bot in its own console: cmd /c executes a command line, not a
|
||||
rem batch, so Ctrl+C shuts it down cleanly without cmd's
|
||||
rem "Terminate batch job (Y/N)?" prompt. This launcher exits immediately.
|
||||
start "musicbot" /d "%~dp0" cmd /c "uv run musicbot --reload"
|
||||
Reference in new issue
Block a user