mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-22 09:25:49 +03:00
Do not cancel current sync request when going to background #5621
Incremental sync can be long and it requires the user to wait for the treatment to end, else all is restarted from the beginning each time the user moves the app to foreground.
This commit is contained in:
parent
dbf10a222f
commit
03d6aa8cd3
2 changed files with 5 additions and 2 deletions
1
changelog.d/5719.feature
Normal file
1
changelog.d/5719.feature
Normal file
|
@ -0,0 +1 @@
|
|||
Do not cancel the current incremental sync request and treatment when the app goes to background
|
|
@ -104,10 +104,12 @@ internal class SyncThread @Inject constructor(private val syncTask: SyncTask,
|
|||
|
||||
fun pause() = synchronized(lock) {
|
||||
if (isStarted) {
|
||||
Timber.tag(loggerTag.value).d("Pause sync...")
|
||||
Timber.tag(loggerTag.value).d("Pause sync... Not cancelling incremental sync")
|
||||
isStarted = false
|
||||
retryNoNetworkTask?.cancel()
|
||||
syncScope.coroutineContext.cancelChildren()
|
||||
// Do not cancel the current incremental sync.
|
||||
// Incremental sync can be long and it requires the user to wait for the treatment to end,
|
||||
// else all is restarted from the beginning each time the user moves the app to foreground.
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue