mirror of
https://github.com/senju1337/senju.git
synced 2025-12-23 23:39:27 +00:00
refactor: Change location of haiku index to persist across funciton execution
Refs: OPS-62
This commit is contained in:
parent
877eaafbaf
commit
dc078b0b36
1 changed files with 2 additions and 1 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue