1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 23:51:09 +03:00

make celery-watcher less noisy

This commit is contained in:
Ryan Petrello 2018-07-02 10:08:02 -04:00
parent 6f63c7ba38
commit a8eb4327ea
No known key found for this signature in database
GPG Key ID: F2AA5F2122351777

View File

@ -2,11 +2,11 @@ import os
import signal
import subprocess
import sys
import socket
import time
from celery import Celery
from django.core.management.base import BaseCommand
from django.conf import settings
class Command(BaseCommand):
@ -38,12 +38,10 @@ class Command(BaseCommand):
app.config_from_object('django.conf:settings')
while True:
try:
pongs = app.control.ping(['celery@{}'.format(socket.gethostname())])
pongs = app.control.ping(['celery@{}'.format(settings.CLUSTER_HOST_ID)])
except Exception:
pongs = []
if len(pongs):
sys.stderr.write(str(pongs) + '\n')
else:
if not pongs:
sys.stderr.write('celery is not responsive to ping over local AMQP\n')
pid = self.getpid()
if pid: