Ask Your Question
1

What is the way to hold off until Flask handles all requests?

asked 2021-04-23 11:00:00 +0000

scrum gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-05-13 10:00:00 +0000

djk gravatar image

Flask by design already handles each request sequentially and does not start processing the next request until the current request is complete. However, to ensure all requests are handled before Flask stops running, you can use the Flask run() method with the use_reloader argument set to False. This prevents the Flask development server from reloading, which in turn allows it to keep running until all requests have been handled. Here is an example:

if __name__ == '__main__':
    app.run(use_reloader=False)
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2021-04-23 11:00:00 +0000

Seen: 19 times

Last updated: May 13 '21