mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-15 15:02:49 +01:00
refactor(GoogleDrive): update backoff delay.
Signed-off-by: KaiserBh <kaiserbh@proton.me>
This commit is contained in:
parent
e04d191dfb
commit
a13e731d1c
@ -71,7 +71,7 @@ class GoogleDriveSyncService(context: Context, json: Json, syncPreferences: Sync
|
||||
googleDriveService.refreshToken()
|
||||
val drive = googleDriveService.driveService ?: throw Exception("Google Drive service not initialized")
|
||||
|
||||
var backoff = 2000L
|
||||
var backoff = 1000L
|
||||
|
||||
while (true) {
|
||||
val lockFiles = findLockFile(drive)
|
||||
@ -99,7 +99,7 @@ class GoogleDriveSyncService(context: Context, json: Json, syncPreferences: Sync
|
||||
else -> {
|
||||
logcat(LogPriority.DEBUG) { "Multiple lock files found, applying backoff" }
|
||||
delay(backoff) // Apply backoff strategy
|
||||
backoff = (backoff * 2).coerceAtMost(32000L)
|
||||
backoff = (backoff * 2).coerceAtMost(16000L)
|
||||
logcat(LogPriority.DEBUG) { "Backoff increased to $backoff milliseconds" }
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user