From 64601e0581208de22ddc8261940cb0376694c162 Mon Sep 17 00:00:00 2001 From: mingyang feng <39239059+bird-man04@users.noreply.github.com> Date: Fri, 14 May 2021 09:39:36 +0800 Subject: [PATCH] Fixes logical judgment expression #5683 (#5685) * One aspect of code quality is to have better expressions. * Update ClientBeatProcessor.java * Update ClientBeatProcessor.java --- .../naming/healthcheck/ClientBeatProcessor.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/naming/src/main/java/com/alibaba/nacos/naming/healthcheck/ClientBeatProcessor.java b/naming/src/main/java/com/alibaba/nacos/naming/healthcheck/ClientBeatProcessor.java index a2b147b6c..6dca4ac6d 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/healthcheck/ClientBeatProcessor.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/healthcheck/ClientBeatProcessor.java @@ -81,15 +81,13 @@ public class ClientBeatProcessor implements Runnable { Loggers.EVT_LOG.debug("[CLIENT-BEAT] refresh beat: {}", rsInfo.toString()); } instance.setLastBeat(System.currentTimeMillis()); - if (!instance.isMarked()) { - if (!instance.isHealthy()) { - instance.setHealthy(true); - Loggers.EVT_LOG - .info("service: {} {POS} {IP-ENABLED} valid: {}:{}@{}, region: {}, msg: client beat ok", - cluster.getService().getName(), ip, port, cluster.getName(), - UtilsAndCommons.LOCALHOST_SITE); - getPushService().serviceChanged(service); - } + if (!instance.isMarked() && !instance.isHealthy()) { + instance.setHealthy(true); + Loggers.EVT_LOG + .info("service: {} {POS} {IP-ENABLED} valid: {}:{}@{}, region: {}, msg: client beat ok", + cluster.getService().getName(), ip, port, cluster.getName(), + UtilsAndCommons.LOCALHOST_SITE); + getPushService().serviceChanged(service); } } }