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