Browse Source

Obsolete – we don't create anonymous checks any more.

pull/199/head
Pēteris Caune 6 years ago
parent
commit
b4e53431cd
No known key found for this signature in database GPG Key ID: E28D7679E9A9EDE2
1 changed files with 0 additions and 14 deletions
  1. +0
    -14
      hc/api/management/commands/prunechecks.py

+ 0
- 14
hc/api/management/commands/prunechecks.py View File

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

Loading…
Cancel
Save