Pergunta

I'm currently creating an image upload system using Python and Flask running on Amazon Elastic Beanstalk.

Everything works fine, but the problem is that the upload blocks the entire web server, including incoming page load requests.

How do I make the file upload run as a separate process? Or allow additional incoming requests? Will this happen automatically if I increase the number of processes available in EC2?

Foi útil?

Solução

I'm putting this as an answer.

You can set the threaded parameter in the main function in Flask like this:

if __name__ == '__main__':
    app.run(threaded=True)
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top