This commit is contained in:
wudong 2022-11-24 09:37:02 +08:00
commit 3697c71ef4

View File

@ -10,6 +10,8 @@
import json
from functools import wraps
from threading import Thread
from multiprocessing import Process
from flask import Blueprint, request
@ -45,7 +47,8 @@ def start_train_algorithm():
def wrapped_function():
param = request.args.get('param')
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)
set_value(key=id, value=False)
t.start()
return output_wrapped(0, 'success', '成功')