Is there a way to call a function when Flask is killed? I want to run some server teardown tasks to gracefully stop my application.
Also, is there a similar analog for Flask startup? I'm currently putting all my startup code in the same file that calls app = Flask(__name__)
- not sure if that's good practice.
Thanks!