Updated on 2026-08-14
This commit is contained in:
commit
f2bdbb33a1
2 changed files with 7 additions and 2 deletions
|
|
@ -123,7 +123,7 @@ internal class MainViewModel @Inject constructor(
|
|||
|
||||
private fun fetchStakingTokens() {
|
||||
viewModelScope.launch(dispatchers.main) {
|
||||
fetchStakingTokensUseCase()
|
||||
fetchStakingTokensUseCase(true)
|
||||
.onLeft { Timber.e(it.toString(), "Unable to fetch the staking tokens list") }
|
||||
.onRight { Timber.d("Staking token list was fetched successfully") }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,9 @@ package com.tangem.datasource.local.logs
|
|||
import android.content.Context
|
||||
import com.tangem.utils.coroutines.CoroutineDispatcherProvider
|
||||
import dagger.hilt.android.qualifiers.ApplicationContext
|
||||
import kotlinx.coroutines.CoroutineExceptionHandler
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.SupervisorJob
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.sync.Mutex
|
||||
import kotlinx.coroutines.sync.withLock
|
||||
|
|
@ -30,7 +32,10 @@ class AppLogsStore @Inject constructor(
|
|||
dispatchers: CoroutineDispatcherProvider,
|
||||
) {
|
||||
|
||||
private val scope = CoroutineScope(dispatchers.io)
|
||||
private val scope = CoroutineScope(
|
||||
context = SupervisorJob() + dispatchers.io +
|
||||
CoroutineExceptionHandler { _, error -> Timber.e("AppLogsStore.scope is failed $error") },
|
||||
)
|
||||
private val mutex = Mutex()
|
||||
|
||||
private val file = File(applicationContext.filesDir, LOG_FILE_NAME)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue