未验证 提交 8f0a5b68 编写于 作者: H huangjianhui 提交者: GitHub

Merge pull request #1485 from felixhjh/v0.7.0

Merge pull request #1470 from felixhjh/dev_local
...@@ -59,6 +59,9 @@ def kill_stop_process_by_pid(command : str, pid : int): ...@@ -59,6 +59,9 @@ def kill_stop_process_by_pid(command : str, pid : int):
if not pid_is_exist(pid): if not pid_is_exist(pid):
print("Process [%s] has been stopped."%pid) print("Process [%s] has been stopped."%pid)
return return
if platform.system() == "Windows":
os.kill(pid, signal.SIGINT)
else:
try: try:
if command == "stop": if command == "stop":
os.killpg(pid, signal.SIGINT) os.killpg(pid, signal.SIGINT)
......
...@@ -28,6 +28,7 @@ import os ...@@ -28,6 +28,7 @@ import os
from paddle_serving_server import pipeline from paddle_serving_server import pipeline
from paddle_serving_server.pipeline import Op from paddle_serving_server.pipeline import Op
from paddle_serving_server.serve import format_gpu_to_strlist from paddle_serving_server.serve import format_gpu_to_strlist
from paddle_serving_server.util import dump_pid_file
def port_is_available(port): def port_is_available(port):
...@@ -261,6 +262,8 @@ class WebService(object): ...@@ -261,6 +262,8 @@ class WebService(object):
self.op_num = op_num self.op_num = op_num
self.op_max_batch = op_max_batch self.op_max_batch = op_max_batch
# record port and pid info for stopping process
dump_pid_file([self.port], "web_service")
# if gpuid != None, we will use gpuid first. # if gpuid != None, we will use gpuid first.
# otherwise, keep the self.gpus unchanged. # otherwise, keep the self.gpus unchanged.
# maybe self.gpus is set by the Function set_gpus. # maybe self.gpus is set by the Function set_gpus.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册