Hello! I have a problem with Flask response. I have the @response.call_on_close function but it's not getting called when the client disconnects
@app.route("/connect", methods=["POST"])
def connect():
client = CLIENT()
clients.append(client)
def generate():
while True:
yield 'none\n'
response = Response(generate(), mimetype='text/plain')
@response.call_on_close
def remove():
print('removing')
clients.remove(client)
return response
the remove() function never gets called for some reason, any help is appreciated!