mirror of
https://github.com/senju1337/senju.git
synced 2025-12-24 07:39:29 +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"))
|
store = StoreManager(Path("/tmp/store.db"))
|
||||||
|
|
||||||
stored_date = date.today()
|
stored_date = date.today()
|
||||||
|
random_number = 1
|
||||||
|
|
||||||
|
|
||||||
@app.route("/")
|
@app.route("/")
|
||||||
|
|
@ -71,8 +72,8 @@ def index_view():
|
||||||
:rtype: flask.Response
|
:rtype: flask.Response
|
||||||
"""
|
"""
|
||||||
global stored_date
|
global stored_date
|
||||||
|
global random_number
|
||||||
|
|
||||||
random_number = 1
|
|
||||||
if stored_date != date.today():
|
if stored_date != date.today():
|
||||||
random_number = random.randint(0, store.count_entries())
|
random_number = random.randint(0, store.count_entries())
|
||||||
stored_date = date.today()
|
stored_date = date.today()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue