refactor: Change location of haiku index to persist across funciton execution

Refs: OPS-62
This commit is contained in:
Alivecow 2025-03-27 09:07:55 +01:00
parent 877eaafbaf
commit dc078b0b36

View file

@ -60,6 +60,7 @@ app = Flask(__name__)
store = StoreManager(Path("/tmp/store.db"))
stored_date = date.today()
random_number = 1
@app.route("/")
@ -71,8 +72,8 @@ def index_view():
:rtype: flask.Response
"""
global stored_date
global random_number
random_number = 1
if stored_date != date.today():
random_number = random.randint(0, store.count_entries())
stored_date = date.today()