mirror of
https://github.com/oxen-io/session-android.git
synced 2025-03-31 07:02:14 +00:00
Cleanup comment
This commit is contained in:
parent
40db23d341
commit
4992123baf
@ -40,12 +40,16 @@ class VersionDataFetcher @Inject constructor(
|
|||||||
|
|
||||||
private val scope = CoroutineScope(Dispatchers.Default)
|
private val scope = CoroutineScope(Dispatchers.Default)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Schedules fetching version data [delayMillis] milliseconds from now.
|
||||||
|
*
|
||||||
|
* This method will fetch immediately if 4 hours or more has elapsed since the last successful
|
||||||
|
* check.
|
||||||
|
*/
|
||||||
fun startTimedVersionCheck(
|
fun startTimedVersionCheck(
|
||||||
delayMillis: Long = REFRESH_TIME_MS + prefs.getLastVersionCheck() - System.currentTimeMillis()
|
delayMillis: Long = REFRESH_TIME_MS + prefs.getLastVersionCheck() - System.currentTimeMillis()
|
||||||
) {
|
) {
|
||||||
stopTimedVersionCheck()
|
stopTimedVersionCheck()
|
||||||
|
|
||||||
// Call immediately if 4h or more has elapsed since the last successful check else schedule.
|
|
||||||
handler.postDelayed(fetchVersionData, delayMillis)
|
handler.postDelayed(fetchVersionData, delayMillis)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user