Flask auto-reload and long-running thread
问题 I'm implementing a long-running thread within a Flask application. In debug mode, with the reloader activated, the long-running thread is not killed upon reload. Instead, because the code that creates and starts the thread is run after reloading, each cycle creates an additional thread. How can I prevent this, other than disabling the reloader? Will the same happen when running under mod_wsgi, with its auto-reload feature? Update : the long-running thread was actually killed by Werkzeug upon