From b4e53431cda80ac7e029962bd9e577b2270cadf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=93teris=20Caune?= Date: Tue, 23 Oct 2018 12:32:31 +0300 Subject: [PATCH] =?UTF-8?q?Obsolete=20=E2=80=93=20we=20don't=20create=20an?= =?UTF-8?q?onymous=20checks=20any=20more.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hc/api/management/commands/prunechecks.py | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 hc/api/management/commands/prunechecks.py diff --git a/hc/api/management/commands/prunechecks.py b/hc/api/management/commands/prunechecks.py deleted file mode 100644 index c98f015c..00000000 --- a/hc/api/management/commands/prunechecks.py +++ /dev/null @@ -1,14 +0,0 @@ -from datetime import timedelta - -from django.core.management.base import BaseCommand -from django.utils import timezone -from hc.api.models import Check - - -class Command(BaseCommand): - help = 'Prune anonymous checks older than 2 hours' - - def handle(self, *args, **options): - cutoff = timezone.now() - timedelta(hours=2) - n, _ = Check.objects.filter(user=None, created__lt=cutoff).delete() - return "Done! Pruned %d checks." % n