Updated on 2026-08-14
This commit is contained in:
parent
d4bafed03c
commit
672f65984f
1 changed files with 7 additions and 0 deletions
|
|
@ -18,6 +18,7 @@ import com.tangem.domain.tokens.repository.NetworksRepository
|
|||
import com.tangem.domain.tokens.repository.QuotesRepository
|
||||
import com.tangem.domain.wallets.models.UserWalletId
|
||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.flow.*
|
||||
|
||||
internal class CurrenciesStatusesLceOperations(
|
||||
|
|
@ -169,6 +170,8 @@ internal class CurrenciesStatusesLceOperations(
|
|||
.map<Set<Quote>, Either<TokenListError, Set<Quote>>> { it.right() }
|
||||
.retryWhen { cause, _ ->
|
||||
emit(TokenListError.DataError(cause).left())
|
||||
// adding delay before retry to avoid spam when flow restarted
|
||||
delay(RETRY_QUOTES_DELAY)
|
||||
true
|
||||
}
|
||||
.distinctUntilChanged()
|
||||
|
|
@ -215,4 +218,8 @@ internal class CurrenciesStatusesLceOperations(
|
|||
else -> null
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val RETRY_QUOTES_DELAY = 2000L
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue