Quicker prunenotifications, skip checks with low n_pings values.

This commit is contained in:
Pēteris Caune 2019-01-22 11:09:41 +02:00
parent a144bc762d
commit 7ecd0b606d
No known key found for this signature in database
GPG Key ID: E28D7679E9A9EDE2

View File

@ -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,