【发布时间】:2017-07-03 15:07:02
【问题描述】:
我正在尝试为 Flask 应用程序提供服务,并希望在特定时间窗口(例如每天上午 9 点)重新加载 pickle 文件。我试图用计时器在我的烧瓶应用程序的末尾放置一个 while 循环,但这最终会挂起我的应用程序。目前的设置是...
# main.wsgi
from main import app as application
# main.py
data = pickle.load("/path/to/pickle.file")
@app.route("/")
def func():
return render_template("base.html", data_to_serve = data)
# Can I write something here to reload the data at specific time points?
【问题讨论】: