aboutsummaryrefslogtreecommitdiff
path: root/cli.py
diff options
context:
space:
mode:
authorGravatar SwiftyOS <craigswift13@gmail.com> 2023-09-29 11:03:52 +0200
committerGravatar SwiftyOS <craigswift13@gmail.com> 2023-09-29 11:03:52 +0200
commit4840dd25a311be94ef8a7f75ed5f4c85f0dacb70 (patch)
tree28aa469bb1eb70bb39312956bbdda6e5408ef370 /cli.py
parentUpdate frontend build (#5393) (diff)
downloadAuto-GPT-4840dd25a311be94ef8a7f75ed5f4c85f0dacb70.tar.gz
Auto-GPT-4840dd25a311be94ef8a7f75ed5f4c85f0dacb70.tar.bz2
Auto-GPT-4840dd25a311be94ef8a7f75ed5f4c85f0dacb70.zip
Updated stop command to kill the benchmark server as well
Diffstat (limited to 'cli.py')
-rw-r--r--cli.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/cli.py b/cli.py
index 705aae299..5caecfb3a 100644
--- a/cli.py
+++ b/cli.py
@@ -301,12 +301,14 @@ def stop():
try:
pid = int(subprocess.check_output(["lsof", "-t", "-i", ":8000"]))
os.kill(pid, signal.SIGTERM)
- click.echo("Agent stopped")
- except subprocess.CalledProcessError as e:
- click.echo("Error: Unexpected error occurred.")
- except ProcessLookupError:
- click.echo("Error: No process with the specified PID was found.")
+ except subprocess.CalledProcessError:
+ click.echo("No process is running on port 8000")
+ try:
+ pid = int(subprocess.check_output(["lsof", "-t", "-i", ":8080"]))
+ os.kill(pid, signal.SIGTERM)
+ except subprocess.CalledProcessError:
+ click.echo("No process is running on port 8080")
@agent.command()
def list():