From 4992123bafcd2a40a9f5b5c4e822f87a57b0ff6f Mon Sep 17 00:00:00 2001 From: bemusementpark Date: Wed, 31 Jul 2024 16:00:23 +0930 Subject: [PATCH] Cleanup comment --- .../org/thoughtcrime/securesms/util/VersionDataFetcher.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/util/VersionDataFetcher.kt b/app/src/main/java/org/thoughtcrime/securesms/util/VersionDataFetcher.kt index 2868e4e8db..20f8ca5308 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/util/VersionDataFetcher.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/util/VersionDataFetcher.kt @@ -40,12 +40,16 @@ class VersionDataFetcher @Inject constructor( 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( delayMillis: Long = REFRESH_TIME_MS + prefs.getLastVersionCheck() - System.currentTimeMillis() ) { stopTimedVersionCheck() - - // Call immediately if 4h or more has elapsed since the last successful check else schedule. handler.postDelayed(fetchVersionData, delayMillis) }