Skip to content

Commit

Permalink
Fix health check is disabled bug
Browse files Browse the repository at this point in the history
  • Loading branch information
nkorange committed Oct 17, 2018
1 parent f1b3e7d commit 0c034d5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,11 @@ private static class ServerStatusReporter implements Runnable {
@Override
public void run() {
try {

if (RunningConfig.getServerPort() <= 0) {
return;
}

for (String key : distroConfig.keySet()) {
for (Server server : distroConfig.get(key)) {
server.alive = System.currentTimeMillis() - server.lastRefTime < Switch.getdistroServerExpiredMillis();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ private void initConfig() {
try {
leader = RaftCore.getPeerSet().getLeader();
if (leader != null) {
Loggers.SRV_LOG.info("[AUTO-INIT] no leader now, sleep 3 seconds and try again.");
Loggers.SRV_LOG.info("[AUTO-INIT] leader is: " + leader.ip);
break;
}

Expand Down

0 comments on commit 0c034d5

Please sign in to comment.