Skip to content

Commit

Permalink
perform platform enablement check earlier
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewazores committed Feb 6, 2024
1 parent 05d7538 commit f22bfb7
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/main/java/io/cryostat/discovery/BuiltInDiscovery.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ public void start(Promise<Void> start) {
.distinct()
.forEach(
platform -> {
if (!platform.isEnabled()) {
logger.info(
"Skipping built-in discovery with {} : not enabled",
platform.getClass().getSimpleName());
return;
}
logger.info(
"Starting built-in discovery with {}",
platform.getClass().getSimpleName());
Expand Down Expand Up @@ -109,11 +115,9 @@ public void start(Promise<Void> start) {
.onSuccess(
subtree -> storage.update(id, subtree.getChildren()));
try {
if (platform.isEnabled()) {
platform.start();
platform.load(promise);
enabledClients.add(platform);
}
platform.start();
platform.load(promise);
enabledClients.add(platform);
} catch (Exception e) {
logger.warn(e);
}
Expand Down

0 comments on commit f22bfb7

Please sign in to comment.