Merge pull request #118 from AlanCoding/no_active_task_list

remove support for celery_active_tasks
This commit is contained in:
Alan Rominger
2017-07-31 15:25:53 -04:00
committed by GitHub
3 changed files with 0 additions and 9 deletions

View File

@@ -18,8 +18,6 @@ from collections import OrderedDict
# Django # Django
from django.conf import settings from django.conf import settings
from django.contrib.auth.models import User, AnonymousUser
from django.core.cache import cache
from django.core.exceptions import FieldError from django.core.exceptions import FieldError
from django.db.models import Q, Count, F from django.db.models import Q, Count, F
from django.db import IntegrityError, transaction, connection from django.db import IntegrityError, transaction, connection
@@ -228,16 +226,12 @@ class ApiV1PingView(APIView):
Everything returned here should be considered public / insecure, as Everything returned here should be considered public / insecure, as
this requires no auth and is intended for use by the installer process. this requires no auth and is intended for use by the installer process.
""" """
active_tasks = cache.get("active_celery_tasks", None)
response = { response = {
'ha': is_ha_environment(), 'ha': is_ha_environment(),
'version': get_awx_version(), 'version': get_awx_version(),
'active_node': settings.CLUSTER_HOST_ID, 'active_node': settings.CLUSTER_HOST_ID,
} }
if not isinstance(request.user, AnonymousUser):
response['celery_active_tasks'] = json.loads(active_tasks) if active_tasks is not None else None
response['instances'] = [] response['instances'] = []
for instance in Instance.objects.all(): for instance in Instance.objects.all():
response['instances'].append(dict(node=instance.hostname, heartbeat=instance.modified, response['instances'].append(dict(node=instance.hostname, heartbeat=instance.modified,

View File

@@ -4,7 +4,6 @@
# Python # Python
from datetime import datetime, timedelta from datetime import datetime, timedelta
import logging import logging
import json
from sets import Set from sets import Set
# Django # Django
@@ -405,7 +404,6 @@ class TaskManager():
logger.debug("Failing inconsistent running jobs.") logger.debug("Failing inconsistent running jobs.")
celery_task_start_time = tz_now() celery_task_start_time = tz_now()
active_task_queues, active_tasks = self.get_active_tasks() active_task_queues, active_tasks = self.get_active_tasks()
cache.set("active_celery_tasks", json.dumps(active_task_queues))
cache.set('last_celery_task_cleanup', tz_now()) cache.set('last_celery_task_cleanup', tz_now())
if active_tasks is None: if active_tasks is None:

View File

@@ -233,7 +233,6 @@ of the Cluster. This includes:
* The instance servicing the HTTP request * The instance servicing the HTTP request
* The last heartbeat time of all other instances in the cluster * The last heartbeat time of all other instances in the cluster
* The state of the Job Queue
* The RabbitMQ cluster status * The RabbitMQ cluster status
* Instance Groups and Instance membership in those groups * Instance Groups and Instance membership in those groups