mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-11-24 00:55:07 +08:00
🐛 Fix: none 系列驱动器启动失败时未退出应用 (#2687)
This commit is contained in:
parent
4254fdfd8c
commit
9655b941f3
@ -68,9 +68,11 @@ class Driver(BaseDriver):
|
|||||||
await self._lifespan.startup()
|
await self._lifespan.startup()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.opt(colors=True, exception=e).error(
|
logger.opt(colors=True, exception=e).error(
|
||||||
"<r><bg #f8bbd0>Error when running startup function. "
|
"<r><bg #f8bbd0>Application startup failed. "
|
||||||
"Ignored!</bg #f8bbd0></r>"
|
"Exiting.</bg #f8bbd0></r>"
|
||||||
)
|
)
|
||||||
|
self.should_exit.set()
|
||||||
|
return
|
||||||
|
|
||||||
logger.info("Application startup completed.")
|
logger.info("Application startup completed.")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user