如何在不重启 uwsgi 实例的情况下更新 Flask 模板?
How can i update flask templates without restarting the uwsgi instance?
我有一个使用 uwsgi 实例的烧瓶应用程序。当 cron 命令启动时,此应用程序在后台运行一些线程。有没有一种方法可以在不重新启动 uwsgi 服务的情况下更新我的模板文件?
目前我正在等待线程停止,然后重新加载 uwsgi 服务。
启用 TEMPLATES_AUTO_RELOAD
效果很好:
app = Flask(__name__)
app.config['TEMPLATES_AUTO_RELOAD'] = True
Whether to check for modifications of the template source and reload
it automatically. By default the value is None which means that Flask
checks original file only in debug mode.
我有一个使用 uwsgi 实例的烧瓶应用程序。当 cron 命令启动时,此应用程序在后台运行一些线程。有没有一种方法可以在不重新启动 uwsgi 服务的情况下更新我的模板文件?
目前我正在等待线程停止,然后重新加载 uwsgi 服务。
启用 TEMPLATES_AUTO_RELOAD
效果很好:
app = Flask(__name__)
app.config['TEMPLATES_AUTO_RELOAD'] = True
Whether to check for modifications of the template source and reload it automatically. By default the value is None which means that Flask checks original file only in debug mode.