Removed the command to purge request_profiler entries, given that request_profiler is incompatible with Django 2.2
- Legacy-Id: 18107
This commit is contained in:
parent
0a7b3be977
commit
0924640676
|
@ -59,6 +59,3 @@ $DTDIR/ietf/manage.py fetch_meeting_attendance --latest 2
|
||||||
|
|
||||||
# Send reminders originating from the review app
|
# Send reminders originating from the review app
|
||||||
$DTDIR/ietf/bin/send-review-reminders
|
$DTDIR/ietf/bin/send-review-reminders
|
||||||
|
|
||||||
# Purge old request_profiler records
|
|
||||||
$DTDIR/ietf/manage.py purge_request_profiler_records -d2
|
|
||||||
|
|
|
@ -1,31 +0,0 @@
|
||||||
# Copyright The IETF Trust 2020, All Rights Reserved
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
import datetime
|
|
||||||
|
|
||||||
from textwrap import dedent
|
|
||||||
|
|
||||||
from django.core.management.base import BaseCommand
|
|
||||||
|
|
||||||
import debug # pyflakes:ignore
|
|
||||||
|
|
||||||
from request_profiler.models import ProfilingRecord
|
|
||||||
|
|
||||||
class Command(BaseCommand):
|
|
||||||
"""
|
|
||||||
Purge information older than a given number of days (default 30) from the
|
|
||||||
profiling records table
|
|
||||||
"""
|
|
||||||
|
|
||||||
help = dedent(__doc__).strip()
|
|
||||||
|
|
||||||
|
|
||||||
def add_arguments(self, parser):
|
|
||||||
parser.add_argument('-d', '--days', dest='days', type=int, default=3,
|
|
||||||
help='Purge records older than this (default %(default)s days).')
|
|
||||||
|
|
||||||
def handle(self, *filenames, **options):
|
|
||||||
start = datetime.datetime.now() - datetime.timedelta(days=int(options['days']))
|
|
||||||
deleted = ProfilingRecord.objects.filter(start_ts__lt=start).delete()
|
|
||||||
if options['verbosity'] > 1:
|
|
||||||
self.stdout.write('deleted: %s' % str(deleted))
|
|
Loading…
Reference in a new issue