forked from CGM_Public/pretix_original
Move quota cache from database to redis (#2010)
This commit is contained in:
@@ -202,14 +202,10 @@ def quota_widgets(sender, subevent=None, lazy=False, **kwargs):
|
||||
widgets = []
|
||||
quotas = sender.quotas.filter(subevent=subevent)
|
||||
|
||||
quotas_to_compute = [
|
||||
q for q in quotas
|
||||
if not q.cache_is_hot(now() + timedelta(seconds=5))
|
||||
]
|
||||
qa = QuotaAvailability()
|
||||
if quotas_to_compute:
|
||||
qa.queue(*quotas_to_compute)
|
||||
qa.compute()
|
||||
if quotas:
|
||||
qa.queue(*quotas)
|
||||
qa.compute(allow_cache=True)
|
||||
|
||||
for q in quotas:
|
||||
if not lazy:
|
||||
|
||||
Reference in New Issue
Block a user