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