instacart / instacart/truetime-android

Clock drift mitigation suggestion not working

Open
#121 11 comments 4 reactions 0 assignees View on GitHub
Dominant language
Kotlin
Stars
1.5k
Forks
196
PR merge metrics
No merged PRs in 30d

Description

Under `Clock drift and the need for Re-syncing` the following is stated:
> rerun the TrueTime.init call at regular/frequent intervals so you resynchronize with the true time

However looking at the lib code gives:
```
protected void initialize(String ntpHost) throws IOException {
if (isInitialized()) {
TrueLog.i(TAG, "---- TrueTime already initialized from previous boot/init");
return;
}
requestTime(ntpHost);
saveTrueTimeInfoToDisk();
}
```
which effectively skips fetching new time from NTP if value already cached in RAM. (I'm not using saving to prefs option.)

So how can I make the lib sync time every now and then?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.