Вопрос

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?

Это было полезно?

Решение

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)
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top