提交 145a26f7 编写于 作者: M MRXLT

bug fix

上级 c428a899
...@@ -129,14 +129,26 @@ def start_serving(): ...@@ -129,14 +129,26 @@ def start_serving():
class MainService(BaseHTTPRequestHandler): class MainService(BaseHTTPRequestHandler):
def setup(self):
BaseHTTPRequestHandler.setup(self)
self.p_flag = False
def start(self):
print(self.p_flag)
if not self.p_flag:
from multiprocessing import Pool
pool = Pool(3)
pool.apply_async(start_serving)
self.p_status = 1
self.p_flag = True
else:
pass
return True
def do_POST(self): def do_POST(self):
content_length = int(self.headers['Content-Length']) content_length = int(self.headers['Content-Length'])
post_data = self.rfile.read(content_length) post_data = self.rfile.read(content_length)
#p = subprocess.Popen(start_serving()) if self.start():
from multiprocessing import Pool
pool = Pool(3)
pool.apply_async(start_serving)
if 1:
response = {"endpoint_list": [args.port]} response = {"endpoint_list": [args.port]}
else: else:
response = {"message": "start serving failed"} response = {"message": "start serving failed"}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册