🐛 fix: 修复重启bot时可能发生报错的问题
在 gewechat, wecom 等消息平台没启动成功的情况下重启bot会报错
This commit is contained in:
@@ -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("企业微信 适配器已被优雅地关闭")
|
||||
|
||||
Reference in New Issue
Block a user