Optimize boot time

This commit is contained in:
utkabobr
2025-04-01 23:06:08 +03:00
parent 6092f123b5
commit 662018834e
14 changed files with 337 additions and 41 deletions
@@ -0,0 +1,24 @@
package ru.ytkab0bp.slicebeam.boot;
import com.instacart.library.truetime.TrueTime;
import java.io.IOException;
public class TrueTimeTask extends BootTask {
/** @noinspection BusyWait*/
public TrueTimeTask() {
super(() -> {
while (true) {
try {
TrueTime.build().withNtpHost("0.ru.pool.ntp.org").initialize();
break;
} catch (IOException ignore) {
try {
Thread.sleep(100);
} catch (InterruptedException ignored) {}
}
}
});
onWorker();
}
}