From e7da35375ba30145e9e925c1c1c4d13405cb57df Mon Sep 17 00:00:00 2001 From: Tangem Date: Thu, 12 Oct 2023 16:01:51 +0300 Subject: [PATCH] Updated on 2026-08-14 --- .../repository/DefaultNetworksRepository.kt | 24 +++---------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/data/tokens/src/main/kotlin/com/tangem/data/tokens/repository/DefaultNetworksRepository.kt b/data/tokens/src/main/kotlin/com/tangem/data/tokens/repository/DefaultNetworksRepository.kt index 673b9fdf4c..bd536ed456 100644 --- a/data/tokens/src/main/kotlin/com/tangem/data/tokens/repository/DefaultNetworksRepository.kt +++ b/data/tokens/src/main/kotlin/com/tangem/data/tokens/repository/DefaultNetworksRepository.kt @@ -53,7 +53,7 @@ internal class DefaultNetworksRepository( override suspend fun fetchNetworkPendingTransactions(userWalletId: UserWalletId, networks: Set) { withContext(dispatchers.io) { - fetchNetworksPendingTransactionsIfCacheExpired(userWalletId, networks, false) + fetchNetworksPendingTransactions(userWalletId, networks) } } @@ -82,16 +82,12 @@ internal class DefaultNetworksRepository( } } - private suspend fun fetchNetworksPendingTransactionsIfCacheExpired( - userWalletId: UserWalletId, - networks: Set, - refresh: Boolean, - ) { + private suspend fun fetchNetworksPendingTransactions(userWalletId: UserWalletId, networks: Set) { coroutineScope { networks .map { network -> async { - fetchNetworkPendingTransactionsIfCacheExpired(userWalletId, network, refresh) + fetchNetworkPendingTransactions(userWalletId, network) } } .awaitAll() @@ -110,20 +106,6 @@ internal class DefaultNetworksRepository( ) } - private suspend fun fetchNetworkPendingTransactionsIfCacheExpired( - userWalletId: UserWalletId, - network: Network, - refresh: Boolean, - ) { - val key = getNetworksStatusesCacheKey(userWalletId, network) - cacheRegistry.invalidate(key) - cacheRegistry.invokeOnExpire( - key = key, - skipCache = refresh, - block = { fetchNetworkPendingTransactions(userWalletId, network) }, - ) - } - private suspend fun fetchNetworkStatus(userWalletId: UserWalletId, network: Network) { val currencies = getCurrencies(userWalletId, network)