Created
March 20, 2020 20:26
-
-
Save john-stemberger/bab63c3935cdda052d2baf92732a2b85 to your computer and use it in GitHub Desktop.
True Time Re-initilize for dealing with clock drift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.instacart.library.truetime | |
import com.instacart.library.truetime.TrueTime.saveTrueTimeInfoToDisk | |
fun TrueTime.reInitialize(ntpHost: String) { | |
withNtpHost(ntpHost) | |
if (!TrueTime.isInitialized()) { | |
initialize() | |
} else { | |
requestTime(ntpHost) | |
saveTrueTimeInfoToDisk() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Cannot access 'requestTime': it is package-private in 'TrueTime'