🐛 fix: 修复重启bot时可能发生报错的问题

在 gewechat, wecom 等消息平台没启动成功的情况下重启bot会报错
This commit is contained in:
Soulter
2025-04-12 15:01:38 +08:00
parent e3b0ca8ef6
commit d7d1c1544a
2 changed files with 8 additions and 2 deletions
@@ -67,7 +67,10 @@ class GewechatPlatformAdapter(Platform):
async def terminate(self):
self.client.shutdown_event.set()
await self.client.server.shutdown()
try:
await self.client.server.shutdown()
except Exception as _:
pass
logger.info("Gewechat 适配器已被优雅地关闭。")
async def logout(self):
@@ -237,5 +237,8 @@ class WecomPlatformAdapter(Platform):
async def terminate(self):
self.server.shutdown_event.set()
await self.server.server.shutdown()
try:
await self.server.server.shutdown()
except Exception as _:
pass
logger.info("企业微信 适配器已被优雅地关闭")