ruff归零

This commit is contained in:
明天好像没什么
2025-11-01 21:32:41 +08:00
committed by Windpicker-owo
parent f816150782
commit 3db00aa8f3
20 changed files with 121 additions and 61 deletions

6
bot.py
View File

@@ -617,9 +617,9 @@ async def wait_for_user_input():
# 在非生产环境下,使用异步方式等待输入
if os.getenv("ENVIRONMENT") != "production":
logger.info("程序执行完成,按 Ctrl+C 退出...")
# 简单的异步等待,避免阻塞事件循环
while True:
await asyncio.sleep(1)
# 使用 Event 替代 sleep 循环,避免阻塞事件循环
shutdown_event = asyncio.Event()
await shutdown_event.wait()
except KeyboardInterrupt:
logger.info("用户中断程序")
return True