🤖 自动格式化代码 [skip ci]
This commit is contained in:
5
bot.py
5
bot.py
@@ -122,10 +122,7 @@ async def graceful_shutdown():
|
||||
|
||||
# 等待所有任务完成,设置超时
|
||||
try:
|
||||
await asyncio.wait_for(
|
||||
asyncio.gather(*remaining_tasks, return_exceptions=True),
|
||||
timeout=15.0
|
||||
)
|
||||
await asyncio.wait_for(asyncio.gather(*remaining_tasks, return_exceptions=True), timeout=15.0)
|
||||
logger.info("所有剩余任务已成功取消")
|
||||
except asyncio.TimeoutError:
|
||||
logger.warning("等待任务取消超时,强制继续关闭")
|
||||
|
||||
Reference in New Issue
Block a user