mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
WebHost: fix landing page caching and mention amount of multiworlds in the last week.
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
from flask import render_template
|
||||
from WebHostLib import app, cache
|
||||
from .models import *
|
||||
from datetime import timedelta
|
||||
|
||||
|
||||
@cache.memoize(timeout=300)
|
||||
@app.route('/', methods=['GET', 'POST'])
|
||||
@cache.cached(timeout=300) # cache has to appear under app route for caching to work
|
||||
def landing():
|
||||
return render_template("landing.html")
|
||||
multiworlds = count(room for room in Room if room.creation_time >= datetime.utcnow() - timedelta(days=7))
|
||||
return render_template("landing.html", multiworlds=multiworlds)
|
||||
|
Reference in New Issue
Block a user