Python 如何访问请求中的烧瓶属性

Python 如何访问请求中的烧瓶属性,python,flask,Python,Flask,我试图访问一些使用多处理队列更新的flask属性,但它不起作用。代码如下: 类前端: def __init__(self, spot_queue, futures_queue): self.app = Flask(__name__, static_url_path='/static', static_folder='frontend/build/static',

我试图访问一些使用多处理队列更新的flask属性,但它不起作用。代码如下:

类前端:

def __init__(self, spot_queue, futures_queue):
    self.app = Flask(__name__,
                     static_url_path='/static',
                     static_folder='frontend/build/static',
                     template_folder='frontend/build')

    CORS(self.app, resources={r"/*": {"origins": "*"}})
    self.socketio = SocketIO(self.app, cors_allowed_origins="*")

    self.spot = None
    self.spot_queue = spot_queue

    @self.app.route('/')
    def index():
        return render_template("index.html")

    @self.app.route('/refresh')
    def refresh():
        print(dict(spot=self.spot)
        print(self.spot)
        return "test"

    @self.socketio.on('message', '/updates')
    def handle_message(data):
        print('received message: ' + data)

def listen_spot_update(self, queue):
    while 1:
        self.spot = queue.get()
        print(self.spot)

def start(self):
    Process(target=self.listen_spot_update, args=(self.spot_queue,)).start()
    self.socketio.run(self.app)
“listen\u spot\u update”函数中的打印可以工作,但当刷新请求中的打印没有打印时。你能帮帮我吗