Explicitly make the dynamic config worker a daemon thread.

This commit is contained in:
Jon Chambers 2021-02-04 18:53:48 -05:00 committed by Jon Chambers
parent 3298db8683
commit 3a17a7c98f
1 changed files with 5 additions and 2 deletions

View File

@ -72,7 +72,7 @@ public class DynamicConfigurationManager {
this.notifyAll();
}
new Thread(() -> {
final Thread workerThread = new Thread(() -> {
while (true) {
try {
retrieveDynamicConfiguration().ifPresent(configuration::set);
@ -82,7 +82,10 @@ public class DynamicConfigurationManager {
Util.sleep(5000);
}
}).start();
}, "DynamicConfigurationManagerWorker");
workerThread.setDaemon(true);
workerThread.start();
}
private Optional<DynamicConfiguration> retrieveDynamicConfiguration() throws JsonProcessingException {