websocket

This commit is contained in:
wudong 2022-11-25 17:37:28 +08:00
parent 872ae83574
commit b6393491e3

View File

@ -11,7 +11,7 @@ import json
from functools import wraps from functools import wraps
from threading import Thread from threading import Thread
from multiprocessing import Process from multiprocessing import Process
from time import sleep
from flask import Blueprint, request from flask import Blueprint, request
@ -47,6 +47,7 @@ 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')
sleep(10)
dict = manager.active_connections_dist dict = manager.active_connections_dist
# t = Thread(target=func, args=(param, id)) # t = Thread(target=func, args=(param, id))
t = Process(target=func, args=(param, id, dict[id]), name=id) t = Process(target=func, args=(param, id, dict[id]), name=id)