Skip to content

Commit

Permalink
[configuration] avoid to fail when shutting down when reading configu…
Browse files Browse the repository at this point in the history
…ration
  • Loading branch information
rmannibucau committed Feb 12, 2024
1 parent bd667d1 commit 3994ee9
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,11 @@ public synchronized void readConfiguration() throws IOException, SecurityExcepti
}
}), getClass().getName() + "-shutdown");
state.shutdownHook = hook;
Runtime.getRuntime().addShutdownHook(hook);
try {
Runtime.getRuntime().addShutdownHook(hook);
} catch (final RuntimeException re) {
// no-op, shutting down
}
final var location = getProperty("java.util.logging.config.file");
if (location != null) {
final var path = Paths.get(location);
Expand Down

0 comments on commit 3994ee9

Please # to comment.