mirror of
https://github.com/ansible/awx.git
synced 2026-01-13 19:10:07 -03:30
Always check configuration before gathering data.
We shouldn't perform expensive operations if we won't be able to send it. Only log at debug level, otherwise every node will log this every 5 minutes.
This commit is contained in:
parent
3d02bd7a90
commit
4c499b2d80
@ -358,6 +358,9 @@ def gather_analytics():
|
||||
from rest_framework.fields import DateTimeField
|
||||
if not settings.INSIGHTS_TRACKING_STATE:
|
||||
return
|
||||
if not (settings.AUTOMATION_ANALYTICS_URL and settings.REDHAT_USERNAME and settings.REDHAT_PASSWORD):
|
||||
logger.debug('Not gathering analytics, configuration is invalid')
|
||||
return
|
||||
last_gather = Setting.objects.filter(key='AUTOMATION_ANALYTICS_LAST_GATHER').first()
|
||||
if last_gather:
|
||||
last_time = DateTimeField().to_internal_value(last_gather.value)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user