mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-08-16 23:40:59 +00:00
perf: dispose process
This commit is contained in:
+1
-1
@@ -51,8 +51,8 @@ async def main(loop: asyncio.AbstractEventLoop):
|
|||||||
import signal
|
import signal
|
||||||
|
|
||||||
def signal_handler(sig, frame):
|
def signal_handler(sig, frame):
|
||||||
print('[Signal] 程序退出.')
|
|
||||||
app_inst.dispose()
|
app_inst.dispose()
|
||||||
|
print('[Signal] 程序退出.')
|
||||||
os._exit(0)
|
os._exit(0)
|
||||||
|
|
||||||
signal.signal(signal.SIGINT, signal_handler)
|
signal.signal(signal.SIGINT, signal_handler)
|
||||||
|
|||||||
@@ -140,4 +140,5 @@ class PluginRuntimeConnector:
|
|||||||
|
|
||||||
def dispose(self):
|
def dispose(self):
|
||||||
if isinstance(self.ctrl, stdio_client_controller.StdioClientController):
|
if isinstance(self.ctrl, stdio_client_controller.StdioClientController):
|
||||||
|
self.ap.logger.info('Terminating plugin runtime process...')
|
||||||
self.ctrl.process.terminate()
|
self.ctrl.process.terminate()
|
||||||
|
|||||||
Reference in New Issue
Block a user