def run(cls) -> Dict: timeout = conf.get(HEALTH_CHECK_WORKER_TIMEOUT) arg = random.randint(1, 10) result = None try: task_result = celery_app.send_task( cls.WORKER_HEALTH_TASK, args=[arg, arg], expires=timeout, ) task_result.get(timeout=timeout) if task_result.result != health_task(arg, arg): result = Result( message='Service returned wrong health result.', severity=Result.WARNING ) except IOError: result = Result( message='Service has an "IOError".', severity=Result.ERROR ) except Exception as e: result = Result( message='Service has an "{}" error.'.format(e), severity=Result.ERROR ) if not result: result = Result() return {cls.WORKER_NAME: result}
def k8s_events_health(x: int, y: int) -> int: return health_task.health_task(x, y)
def hp_health(x, y): return health_task.health_task(x, y)
def logs_health(x: int, y: int) -> int: return health_task.health_task(x, y)
def pipelines_health(x, y): return health_task.health_task(x, y)
def scheduler_health(x, y): return health_task.health_task(x, y)
def events_health(x, y): return health_task.health_task(x, y)
def pipelines_health(x: int, y: int) -> int: return health_task.health_task(x, y)
def crons_health(x, y): return health_task.health_task(x, y)
def logs_health(x, y): return health_task.health_task(x, y)