mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-12 01:02:37 +02:00
update method of terminate
This commit is contained in:
parent
60fd49ea60
commit
88cea9418c
1 changed files with 9 additions and 9 deletions
|
|
@ -61,16 +61,16 @@ class ExecuteNbCode(Action):
|
|||
await self.nb_client.km.shutdown_kernel(now=True)
|
||||
await self.nb_client.km.cleanup_resources()
|
||||
|
||||
channels = [
|
||||
self.nb_client.kc.stdin_channel, # The channel for handling standard input to the kernel.
|
||||
self.nb_client.kc.hb_channel, # The channel for heartbeat communication between the kernel and client.
|
||||
self.nb_client.kc.control_channel, # The channel for controlling the kernel.
|
||||
]
|
||||
|
||||
# Stops all the running channels for this kernel
|
||||
# The stdin_channel is the channel for handling standard input to the kernel.
|
||||
if self.nb_client.kc.stdin_channel.is_alive():
|
||||
self.nb_client.kc.stdin_channel.stop()
|
||||
# The hb_channel is the channel for heartbeat communication between the kernel and client.
|
||||
if self.nb_client.kc.hb_channel.is_alive():
|
||||
self.nb_client.kc.hb_channel.stop()
|
||||
# The control_channel is the channel for controlling the kernel.
|
||||
if self.nb_client.kc.control_channel.is_alive():
|
||||
self.nb_client.kc.control_channel.stop()
|
||||
for channel in channels:
|
||||
if channel.is_alive():
|
||||
channel.stop()
|
||||
|
||||
self.nb_client.kc = None
|
||||
self.nb_client.km = None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue