Change how analytics is gathered to only gather once per interval

This commit is contained in:
Bill Nottingham
2020-01-20 17:13:14 -05:00
parent 4e46d5d7cd
commit 44e176dde8
5 changed files with 49 additions and 13 deletions

View File

@@ -5,8 +5,6 @@ import os
import re # noqa
import sys
from datetime import timedelta
from celery.schedules import crontab
import random
# global settings
from django.conf import global_settings
@@ -442,7 +440,7 @@ CELERYBEAT_SCHEDULE = {
},
'gather_analytics': {
'task': 'awx.main.tasks.gather_analytics',
'schedule': crontab(hour='*/6', minute=random.randint(0,59))
'schedule': timedelta(minutes=5)
},
'task_manager': {
'task': 'awx.main.scheduler.tasks.run_task_manager',
@@ -666,6 +664,9 @@ PENDO_TRACKING_STATE = "off"
# Note: This setting may be overridden by database settings.
INSIGHTS_TRACKING_STATE = False
# Last gather date for Analytics
AUTOMATION_ANALYTICS_LAST_GATHER = None
AUTOMATION_ANALYTICS_INTERVAL = 14400
# Default list of modules allowed for ad hoc commands.
# Note: This setting may be overridden by database settings.