bitvend: add stats caching

master
informatic 2023-07-15 22:26:21 +02:00
parent 1c4dc95a1e
commit e5f4fbb999
1 changed files with 3 additions and 3 deletions

View File

@ -10,7 +10,7 @@ cashless_purchase_counter = Counter(
)
# @cachetools.cached(cachetools.TTLCache(32, 600))
@cachetools.cached(cachetools.TTLCache(32, 600))
def hall_of_shame():
balance = func.sum(Transaction.amount).label("balance")
candidates = (
@ -30,7 +30,7 @@ def hall_of_shame():
)
# @cachetools.cached(cachetools.TTLCache(32, 600))
@cachetools.cached(cachetools.TTLCache(32, 600))
def hall_of_addicts():
balance = func.sum(Transaction.amount).label("balance")
candidates = (
@ -52,7 +52,7 @@ def hall_of_addicts():
)
# @cachetools.cached(cachetools.TTLCache(32, 600))
@cachetools.cached(cachetools.TTLCache(32, 600))
def bottles_purchased():
return Transaction.query.filter(
Transaction.amount.in_([-500, -600]), Transaction.type == "purchase"