Shared request specific variable between requests? #1723
-
I am not completely sure if this is a bug or expected behavior. The flask global #!/usr/bin/python
# coding: utf-8
import time
from flask import Flask, g
from flask_socketio import SocketIO
app = Flask(__name__)
@app.route('/long')
def long():
g.var = 'long'
time.sleep(10)
return g.var
@app.route('/short')
def short():
g.var = 'short'
return g.var
socketio = SocketIO(app)
if __name__ == '__main__':
socketio.run(app, host='0.0.0.0', port=5000, debug=True) When I first trigger Could anyone explain what is happening? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
I just tried it, I copied and pasted this. It doesn't have that behavior for me. Maybe check all your versions. Or post which versions you are using? I was using from
|
Beta Was this translation helpful? Give feedback.
I just tried it, I copied and pasted this. It doesn't have that behavior for me. Maybe check all your versions. Or post which versions you are using?
I was using from
pip freeze