mirror of
https://github.com/Dark98/SliceBeam.git
synced 2026-07-02 16:49:02 +00:00
Better truetime init
This commit is contained in:
@@ -40,6 +40,12 @@ public class AppBoot {
|
||||
}
|
||||
}
|
||||
Log.d("boot", "Boot in " + (System.currentTimeMillis() - start) + "ms");
|
||||
executor.shutdown();
|
||||
executor = null;
|
||||
pendingMain = null;
|
||||
pendingTasks = null;
|
||||
completed = null;
|
||||
latch = null;
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
@@ -5,12 +5,11 @@ import com.instacart.library.truetime.TrueTime;
|
||||
import java.io.IOException;
|
||||
|
||||
public class TrueTimeTask extends BootTask {
|
||||
/** @noinspection BusyWait*/
|
||||
public TrueTimeTask() {
|
||||
super(() -> {
|
||||
while (true) {
|
||||
for (int i = 0; i < 2; i++) {
|
||||
try {
|
||||
TrueTime.build().withNtpHost("0.ru.pool.ntp.org").initialize();
|
||||
TrueTime.build().withNtpHost("1.ru.pool.ntp.org").initialize();
|
||||
break;
|
||||
} catch (IOException ignore) {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user