Skip to content

Commit

Permalink
fix: 启动适配器时报错也能正常退出
Browse files Browse the repository at this point in the history
  • Loading branch information
he0119 committed Apr 7, 2023
1 parent 1f81416 commit f86f1d7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())

Expand Down

0 comments on commit f86f1d7

Please sign in to comment.