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)
Asked: 2021-04-23 11:00:00 +0000
Seen: 19 times
Last updated: May 13 '21