开启进程-2

This commit is contained in:
JIAKUNHAO 2022-11-24 09:44:58 +08:00
parent 14e21d9faf
commit 295275201c

View File

@ -47,8 +47,8 @@ def start_train_algorithm():
def wrapped_function(): def wrapped_function():
param = request.args.get('param') param = request.args.get('param')
id = request.args.get('id') id = request.args.get('id')
# t = Thread(target=func, args=(param, id)) t = Thread(target=func, args=(param, id))
t = Process(target=func, args=(param, id), name=id) #t = Process(target=func, args=(param, id), name=id)
set_value(key=id, value=False) set_value(key=id, value=False)
t.start() t.start()
return output_wrapped(0, 'success', '成功') return output_wrapped(0, 'success', '成功')