code: def get_celery_info():
      
      import celery
      if not getattr(settings, 'USE_CELERY', False):
          log.error("No celery config found. Set USE_CELERY in settings to enable.")
          return {"status": NO_CONFIG}
      start = datetime.now()
      try:
          # pylint: disable=no-member
          app = celery.Celery('tasks')
          app.config_from_object('django.conf:settings', namespace='CELERY')
          # Make sure celery is connected with max_retries=1
          # and not the default of max_retries=None if the connection
          # is made lazily
          app.connection().ensure_connection(max_retries=1)
  
          celery_stats = celery.task.control.inspect().stats()
          if not celery_stats:
              log.error("No running Celery workers were found.")
              return {"status": DOWN, "message": "No running Celery workers"}
      except Exception as exp:  # pylint: disable=broad-except
          log.error("Error connecting to the backend: %s", exp)
          return {"status": DOWN, "message": "Error connecting to the backend"}
      return {"status": UP, "response_microseconds": (datetime.now() - start).microseconds}
docs: Check celery availability