mirror of
https://github.com/katanemo/plano.git
synced 2026-06-20 15:28:07 +02:00
more update
This commit is contained in:
parent
110ec479cb
commit
fbfa165bca
1 changed files with 4 additions and 4 deletions
|
|
@ -129,18 +129,18 @@ def stop_server():
|
||||||
|
|
||||||
pid_file = get_pid_file()
|
pid_file = get_pid_file()
|
||||||
if os.path.exists(pid_file):
|
if os.path.exists(pid_file):
|
||||||
logger.info("pid file found, shutting down the server.")
|
logger.info("PID file found, shutting down the server.")
|
||||||
# read pid from file
|
# read pid from file
|
||||||
with open(pid_file, "r") as f:
|
with open(pid_file, "r") as f:
|
||||||
pid = int(f.read())
|
pid = int(f.read())
|
||||||
logger.info(f"killing model server {pid}")
|
logger.info(f"Killing model server {pid}")
|
||||||
try:
|
try:
|
||||||
os.kill(pid, signal.SIGKILL)
|
os.kill(pid, signal.SIGKILL)
|
||||||
except ProcessLookupError:
|
except ProcessLookupError:
|
||||||
logger.info(f"process {pid} not found")
|
logger.info(f"Process {pid} not found")
|
||||||
os.remove(pid_file)
|
os.remove(pid_file)
|
||||||
else:
|
else:
|
||||||
logger.info("no pid file found, server is not running.")
|
logger.info("No PID file found, server is not running.")
|
||||||
|
|
||||||
|
|
||||||
def restart_server(port=51000, foreground=False):
|
def restart_server(port=51000, foreground=False):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue