Make build deprecation more resilient to clock skew.

This commit is contained in:
Greyson Parrelli
2024-06-06 10:14:09 -04:00
committed by Alex Hart
parent f572eb5322
commit 3ff218f9c6
11 changed files with 122 additions and 13 deletions

View File

@@ -202,6 +202,12 @@ internal class MiscellaneousValues internal constructor(store: KeyValueStore) :
*/
val lastKnownServerTimeOffset by longValue(SERVER_TIME_OFFSET, 0)
/**
* An estimate of the server time, based on the last-known server time offset.
*/
val estimatedServerTime: Long
get() = System.currentTimeMillis() - lastKnownServerTimeOffset
/**
* The last time (using our local clock) we updated the server time offset returned by [.getLastKnownServerTimeOffset]}.
*/