bitvend: add stats caching
parent
1c4dc95a1e
commit
e5f4fbb999
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue