未验证 提交 fc60604f 编写于 作者: T Thomas Young 提交者: GitHub

Merge branch 'v0.7.0' into v0.7.0

...@@ -59,16 +59,19 @@ def kill_stop_process_by_pid(command : str, pid : int): ...@@ -59,16 +59,19 @@ 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
try: if platform.system() == "Windows":
if command == "stop": os.kill(pid, signal.SIGINT)
os.killpg(pid, signal.SIGINT) else:
elif command == "kill": try:
os.killpg(pid, signal.SIGKILL) if command == "stop":
except ProcessLookupError: os.killpg(pid, signal.SIGINT)
if command == "stop": elif command == "kill":
os.kill(pid, signal.SIGINT) os.killpg(pid, signal.SIGKILL)
elif command == "kill": except ProcessLookupError:
os.kill(pid, signal.SIGKILL) if command == "stop":
os.kill(pid, signal.SIGINT)
elif command == "kill":
os.kill(pid, signal.SIGKILL)
def dump_pid_file(portList, model): def dump_pid_file(portList, model):
''' '''
......
...@@ -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):
...@@ -260,7 +261,6 @@ class WebService(object): ...@@ -260,7 +261,6 @@ class WebService(object):
self.gpu_multi_stream = gpu_multi_stream self.gpu_multi_stream = gpu_multi_stream
self.runtime_thread_num = runtime_thread_num self.runtime_thread_num = runtime_thread_num
self.batch_infer_size = batch_infer_size self.batch_infer_size = batch_infer_size
# record port and pid info for stopping process # record port and pid info for stopping process
dump_pid_file([self.port], "web_service") dump_pid_file([self.port], "web_service")
# if gpuid != None, we will use gpuid first. # if gpuid != None, we will use gpuid first.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册