Explicitly make the dynamic config worker a daemon thread.

This commit is contained in:
Jon Chambers authored and Jon Chambers committed 2021-02-04 19:05:51 -05:00
1 parent 3298db8683
commit 3a17a7c98f
1 file changed
+5 -2
@@ -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 {