From 7d70626db2fb7403d40b8fbc1ae94a17c262bc25 Mon Sep 17 00:00:00 2001 From: Vlad Kozarez Date: Tue, 16 Jul 2024 22:01:43 +0100 Subject: [PATCH] AND-7638 fixed scope cancelling --- .../main/java/com/tangem/operations/backup/BackupService.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tangem-sdk-core/src/main/java/com/tangem/operations/backup/BackupService.kt b/tangem-sdk-core/src/main/java/com/tangem/operations/backup/BackupService.kt index b4ad17d6..7b8fbc90 100644 --- a/tangem-sdk-core/src/main/java/com/tangem/operations/backup/BackupService.kt +++ b/tangem-sdk-core/src/main/java/com/tangem/operations/backup/BackupService.kt @@ -21,7 +21,7 @@ import com.tangem.operations.CommandResponse import kotlinx.coroutines.CoroutineExceptionHandler import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.cancel +import kotlinx.coroutines.cancelChildren import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.launch @@ -77,7 +77,6 @@ class BackupService( throwable.printStackTrace(PrintWriter(sw)) val exceptionAsString: String = sw.toString() Log.error { exceptionAsString } - throw throwable } private val handleErrors = sdk.config.handleErrors @@ -434,7 +433,7 @@ class BackupService( private fun onBackupCompleted() { repo.reset() - backupScope.cancel() + backupScope.coroutineContext.cancelChildren() } sealed class State {