forked from geode-sdk/android-launcher
reduce check time
This commit is contained in:
1 file changed
+2
-2
@@ -250,8 +250,8 @@ class ReleaseManager private constructor(
|
|||||||
val sharedPreferences = PreferenceUtils.get(applicationContext)
|
val sharedPreferences = PreferenceUtils.get(applicationContext)
|
||||||
val lastCheckTime = sharedPreferences.getLong(PreferenceUtils.Key.LAST_UPDATE_CHECK_TIME)
|
val lastCheckTime = sharedPreferences.getLong(PreferenceUtils.Key.LAST_UPDATE_CHECK_TIME)
|
||||||
|
|
||||||
// only check for updates if it's been over 30 minutes since last check
|
// only check for updates if it's been over 15 minutes since last check
|
||||||
val checkMinTime = Clock.System.now().minus(30.minutes).toEpochMilliseconds()
|
val checkMinTime = Clock.System.now().minus(15.minutes).toEpochMilliseconds()
|
||||||
if (!isManual && lastCheckTime > checkMinTime) {
|
if (!isManual && lastCheckTime > checkMinTime) {
|
||||||
_uiState.value = ReleaseManagerState.Finished()
|
_uiState.value = ReleaseManagerState.Finished()
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in new issue
Block a user