mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-10 07:46:02 +00:00
feat: kill runtime process when exit in stdio mode
This commit is contained in:
@@ -156,6 +156,9 @@ class Application:
|
||||
self.logger.error(f'应用运行致命异常: {e}')
|
||||
self.logger.debug(f'Traceback: {traceback.format_exc()}')
|
||||
|
||||
def dispose(self):
|
||||
self.plugin_connector.dispose()
|
||||
|
||||
async def print_web_access_info(self):
|
||||
"""打印访问 webui 的提示"""
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ async def main(loop: asyncio.AbstractEventLoop):
|
||||
|
||||
def signal_handler(sig, frame):
|
||||
print('[Signal] 程序退出.')
|
||||
# ap.shutdown()
|
||||
app_inst.dispose()
|
||||
os._exit(0)
|
||||
|
||||
signal.signal(signal.SIGINT, signal_handler)
|
||||
|
||||
Reference in New Issue
Block a user