Skip to content

Commit

Permalink
Only log about broken instances if there are some (#280)
Browse files Browse the repository at this point in the history
  • Loading branch information
randomanderson authored May 15, 2020
1 parent 120e56a commit 8004234
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/main/java/org/datadog/jmxfetch/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -557,9 +557,7 @@ public TaskStatusHandler invoke(
}

// Attempt to fix broken instances
log.debug("Trying to recover broken instances...");
fixBrokenInstances(reporter);
log.debug("Done trying to recover broken instances.");

try {
appConfig.getStatus().flush();
Expand All @@ -569,6 +567,11 @@ public TaskStatusHandler invoke(
}

private void fixBrokenInstances(Reporter reporter) {
if (brokenInstanceMap.isEmpty()) {
return;
}

log.debug("Trying to recover broken instances...");
List<InstanceTask<Void>> fixInstanceTasks =
new ArrayList<InstanceTask<Void>>(brokenInstanceMap.values().size());

Expand Down Expand Up @@ -629,6 +632,8 @@ public TaskStatusHandler invoke(
} catch (Exception e) {
// NADA
}

log.debug("Done trying to recover broken instances.");
}

/**
Expand Down

0 comments on commit 8004234

Please sign in to comment.