def celery_check():
    try:
        from celery import Celery
        from django.conf import settings
        app = Celery()
        app.config_from_object(settings)
        i = app.control.inspect()
        ping = i.ping()
        if not ping:
            chk = (False, 'No running Celery workers were found.')
        else:
            chk = (True, None)
    except __HOLE__ as e:
        chk = (False, "Error connecting to the backend: " + str(e))
    except ImportError as e:
        chk = (False, str(e))

    return chk
dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/hqwebapp/views.py/celery_check