Updated on 2026-08-14
This commit is contained in:
parent
4e38602301
commit
2317703e37
29 changed files with 369 additions and 169 deletions
|
|
@ -10,7 +10,7 @@ internal class DefaultCacheRegistry(
|
|||
) : CacheRegistry {
|
||||
|
||||
override suspend fun isExpired(key: String): Boolean {
|
||||
val cacheKey = cacheKeysStore.getOrNull(key) ?: return true
|
||||
val cacheKey = cacheKeysStore.getSyncOrNull(key) ?: return true
|
||||
|
||||
return cacheKey.updatedAt
|
||||
.plus(cacheKey.expiresIn)
|
||||
|
|
@ -34,7 +34,7 @@ internal class DefaultCacheRegistry(
|
|||
val isExpired = isExpired(key) || skipCache
|
||||
if (!isExpired) return
|
||||
|
||||
cacheKeysStore.addOrReplace(
|
||||
cacheKeysStore.store(
|
||||
key = CacheKey(
|
||||
id = key,
|
||||
updatedAt = LocalDateTime.now(),
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ internal class DefaultTokensRepository(
|
|||
|
||||
override fun getTokens(userWalletId: UserWalletId, refresh: Boolean): Flow<Set<Token>> = channelFlow {
|
||||
val userWallet = withContext(dispatchers.io) {
|
||||
requireNotNull(userWalletsStore.getOrNull(userWalletId)) {
|
||||
requireNotNull(userWalletsStore.getSyncOrNull(userWalletId)) {
|
||||
"Unable to find a user wallet with provided ID: $userWalletId"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue