From 8bebea61f167df3b9686832d353bdbf48e6faf93 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Tue, 21 Jul 2020 16:58:18 +0200 Subject: [PATCH] Improve performance of quota cache task --- src/pretix/base/services/quotas.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pretix/base/services/quotas.py b/src/pretix/base/services/quotas.py index 7d6a97ef00..a13d6af6a3 100644 --- a/src/pretix/base/services/quotas.py +++ b/src/pretix/base/services/quotas.py @@ -424,5 +424,7 @@ def refresh_quota_caches(): Q(subevent__date_to__isnull=False, subevent__date_to__gte=now() - timedelta(days=14)) | Q(subevent__date_from__gte=now() - timedelta(days=14)) ) + qa = QuotaAvailability(early_out=False) for q in quotas: - q.availability() + qa.queue(q) + qa.compute()