🤖 自动格式化代码 [skip ci]

This commit is contained in:
github-actions[bot]
2025-06-15 05:14:57 +00:00
parent 83ae078d6e
commit a733020228
2 changed files with 36 additions and 33 deletions

6
bot.py
View File

@@ -130,7 +130,7 @@ async def graceful_shutdown():
logger.error(f"等待任务取消时发生异常: {e}")
logger.info("麦麦优雅关闭完成")
# 关闭日志系统,释放文件句柄
shutdown_logging()
@@ -274,13 +274,13 @@ if __name__ == "__main__":
if "loop" in locals() and loop and not loop.is_closed():
loop.close()
logger.info("事件循环已关闭")
# 关闭日志系统,释放文件句柄
try:
shutdown_logging()
except Exception as e:
print(f"关闭日志系统时出错: {e}")
# 在程序退出前暂停,让你有机会看到输出
# input("按 Enter 键退出...") # <--- 添加这行
sys.exit(exit_code) # <--- 使用记录的退出码