Refactor quota calculation (#1668)

This commit is contained in:
Raphael Michel
2020-05-07 09:34:27 +02:00
committed by GitHub
parent feb7f419d3
commit e117545b3f
15 changed files with 550 additions and 200 deletions

View File

@@ -214,8 +214,10 @@ class EventMixin:
vars_reserved = set()
items_gone = set()
vars_gone = set()
r = getattr(self, '_quota_cache', {})
for q in self.active_quotas:
res = q.availability(allow_cache=True)
res = r[q] if q in r else q.availability(allow_cache=True)
if res[0] == Quota.AVAILABILITY_OK:
if q.active_items: