From 7ecd0b606d2be307c1e25936722ec3bd442da5c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=93teris=20Caune?= Date: Tue, 22 Jan 2019 11:09:41 +0200 Subject: [PATCH] Quicker prunenotifications, skip checks with low n_pings values. --- hc/api/management/commands/prunenotifications.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hc/api/management/commands/prunenotifications.py b/hc/api/management/commands/prunenotifications.py index 82cc86dc..dcdcf40b 100644 --- a/hc/api/management/commands/prunenotifications.py +++ b/hc/api/management/commands/prunenotifications.py @@ -10,7 +10,7 @@ class Command(BaseCommand): def handle(self, *args, **options): total = 0 - q = Check.objects.filter(n_pings__gt=0) + q = Check.objects.filter(n_pings__gt=100) q = q.annotate(min_ping_date=Min("ping__created")) for check in q: qq = Notification.objects.filter(owner_id=check.id,