From f86f1d7f7d8d0fff8c143ecbd5c7451f1bb18a35 Mon Sep 17 00:00:00 2001 From: hemengyang Date: Fri, 7 Apr 2023 23:16:01 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=90=AF=E5=8A=A8=E9=80=82=E9=85=8D?= =?UTF-8?q?=E5=99=A8=E6=97=B6=E6=8A=A5=E9=94=99=E4=B9=9F=E8=83=BD=E6=AD=A3?= =?UTF-8?q?=E5=B8=B8=E9=80=80=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bot.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bot.py b/bot.py index 004eee69..544b7125 100644 --- a/bot.py +++ b/bot.py @@ -49,7 +49,13 @@ def _setup(self): self.driver.on_startup(self._startup) async def _startup(self): - await super()._startup() + try: + await super()._startup() + except: + logger.exception("启动 GitHub 适配器时出现异常") + driver = cast(Driver, self.driver) + driver.should_exit.set() + return # 完成启动后创建任务处理 GitHub Action 事件 asyncio.create_task(handle_github_action_event())