@Override public boolean isOk() { serviceQueue.ifEmpty(this::loadIfEmpty); if (serviceQueue.isPresent()) { return !serviceQueue.get().failing(); } else { logger.warn("Service Queue was not found, but isOk() was called on ServiceHealthManager"); return true; } }
@Override public boolean isFailing() { serviceQueue.ifEmpty(this::loadIfEmpty); if (serviceQueue.isPresent()) { return serviceQueue.get().failing(); } else { logger.warn("Service Queue was not found, but isFailing() was called on ServiceHealthManager"); return false; } }
@Override public boolean isFailing() { serviceQueue.ifEmpty(this::loadIfEmpty); if (serviceQueue.isPresent()) { return serviceQueue.get().failing(); } else { logger.warn("Service Queue was not found, but isFailing() was called on ServiceHealthManager"); return false; } }
@Override public boolean isOk() { serviceQueue.ifEmpty(this::loadIfEmpty); if (serviceQueue.isPresent()) { return !serviceQueue.get().failing(); } else { logger.warn("Service Queue was not found, but isOk() was called on ServiceHealthManager"); return true; } }
private void check() { now = timer.now(); long duration = now - lastCheckTime; if (duration > checkInIntervalMS) { lastCheckTime = now; final ServiceQueue serviceQueue = ServiceContext.serviceContext().currentService(); boolean failing = serviceQueue.failing(); if (!failing) { healthServiceAsync.checkInOk(serviceName); } else { healthServiceAsync.checkIn(serviceName, HealthStatus.FAIL); } healthServiceAsync.clientProxyFlush(); } }