private void checkTTL(final NodeHealthStat nodeHealthStat) { if (debug) logger.debug("HealthService::checkTTL() {}", nodeHealthStat.getName()); if (!nodeHealthStat.isOk()) { return; } if (nodeHealthStat.isForever()) { return; } final long duration = super.time - nodeHealthStat.getLastCheckIn(); /* If the duration is greater than the ttl interval, then mark it as failed. */ if (duration > nodeHealthStat.getTtlInMS()) { logger.error("HealthService::checkTTL() {} FAILED TTL check, duration {}", nodeHealthStat.getName(), duration); nodeHealthStat.setReason(HealthFailReason.FAILED_TTL); nodeHealthStat.setStatus(HealthStatus.FAIL); onFail.ifPresent(checkIn -> checkIn.accept(BeanUtils.copy(nodeHealthStat))); } }
private void checkTTL(final NodeHealthStat nodeHealthStat) { if (debug) logger.debug("HealthService::checkTTL() {}", nodeHealthStat.getName()); if (!nodeHealthStat.isOk()) { return; } if (nodeHealthStat.isForever()) { return; } final long duration = super.time - nodeHealthStat.getLastCheckIn(); /* If the duration is greater than the ttl interval, then mark it as failed. */ if (duration > nodeHealthStat.getTtlInMS()) { logger.error("HealthService::checkTTL() {} FAILED TTL check, duration {}", nodeHealthStat.getName(), duration); nodeHealthStat.setReason(HealthFailReason.FAILED_TTL); nodeHealthStat.setStatus(HealthStatus.FAIL); onFail.ifPresent(checkIn -> checkIn.accept(BeanUtils.copy(nodeHealthStat))); } }
private void checkTTL(final NodeHealthStat nodeHealthStat) { if (debug) logger.debug("HealthService::checkTTL() {}", nodeHealthStat.getName()); if (! nodeHealthStat.isOk() ) { return; } if (nodeHealthStat.isForever()) { return; } final long duration = super.time - nodeHealthStat.getLastCheckIn(); /* If the duration is greater than the ttl interval, then mark it as failed. */ if (duration > nodeHealthStat.getTtlInMS()) { logger.error("HealthService::checkTTL() {} FAILED TTL check, duration {}", nodeHealthStat.getName(), duration); nodeHealthStat.setReason(HealthFailReason.FAILED_TTL); nodeHealthStat.setStatus(HealthStatus.FAIL); onFail.ifPresent(checkIn -> checkIn.accept(BeanUtils.copy(nodeHealthStat))); } }