Updated on 2026-08-14
This commit is contained in:
parent
fdc9bdbdae
commit
b3d51d6805
1 changed files with 2 additions and 2 deletions
|
|
@ -17,13 +17,13 @@ internal class DefaultYieldModuleAddressProvider(
|
|||
private val dispatchers: CoroutineDispatcherProvider,
|
||||
) : YieldModuleAddressProvider {
|
||||
|
||||
private data class Key(val userWalletId: UserWalletId, val networkRawId: String)
|
||||
private data class Key(val userWalletId: UserWalletId, val networkId: Network.ID)
|
||||
|
||||
private val cache = ConcurrentHashMap<Key, String>()
|
||||
private val mutex = Mutex()
|
||||
|
||||
override suspend fun getOrFetch(userWalletId: UserWalletId, network: Network): String? {
|
||||
val key = Key(userWalletId, network.rawId)
|
||||
val key = Key(userWalletId, network.id)
|
||||
cache[key]?.let { return it }
|
||||
return withContext(dispatchers.io) {
|
||||
mutex.withLock {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue