Skip to content

Commit

Permalink
ensure JVM ID is nulled if connection fails
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewazores committed Oct 23, 2024
1 parent d454e11 commit 6805f84
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/io/cryostat/targets/TargetJvmIdUpdateJob.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ private void updateTargetJvmId(long id) {
QuarkusTransaction.requiringNew()
.run(
() -> {
Target target = Target.getTargetById(id);
try {
Target target = Target.getTargetById(id);
target.jvmId =
connectionManager
.executeDirect(
Expand All @@ -74,10 +74,11 @@ private void updateTargetJvmId(long id) {
.map(JvmIdentifier::getHash)
.await()
.atMost(connectionTimeout);
target.persist();
} catch (Exception e) {
target.jvmId = null;
logger.error(e);
}
target.persist();
});
}
}

0 comments on commit 6805f84

Please sign in to comment.