HostMetricSummaryMonthly command + views + scheduled task (#13999)

Co-authored-by: Alan Rominger <arominge@redhat.com>
This commit is contained in:
Martin Slemr
2023-07-12 22:40:09 +02:00
committed by GitHub
parent 0edcd688a2
commit 6c5590e0e6
13 changed files with 692 additions and 34 deletions

View File

@@ -17,6 +17,6 @@ class Command(BaseCommand):
months_ago = options.get('months-ago') or None
if not months_ago:
months_ago = getattr(settings, 'CLEANUP_HOST_METRICS_THRESHOLD', 12)
months_ago = getattr(settings, 'CLEANUP_HOST_METRICS_SOFT_THRESHOLD', 12)
HostMetric.cleanup_task(months_ago)

View File

@@ -0,0 +1,9 @@
from django.core.management.base import BaseCommand
from awx.main.tasks.host_metrics import HostMetricSummaryMonthlyTask
class Command(BaseCommand):
help = 'Computing of HostMetricSummaryMonthly'
def handle(self, *args, **options):
HostMetricSummaryMonthlyTask().execute()