Use serving-lifecycle hooks
@app.before_serving – runs once per worker, right before the first request is accepted.
@app.after_serving – runs once on a clean shutdown
Create the requests.Session in the first hook, stash it on the application object and close it in the second.