mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2025-02-16 19:52:03 +00:00
fixes in AutoRecacheReadKeyValueRepo
This commit is contained in:
parent
5180d6fc3e
commit
022297ad3f
@ -52,7 +52,13 @@ open class AutoRecacheReadKeyValueRepo<Id, RegisteredObject>(
|
|||||||
kvCache.contains(key)
|
kvCache.contains(key)
|
||||||
}
|
}
|
||||||
|
|
||||||
override suspend fun getAll(): Map<Id, RegisteredObject> = kvCache.getAll()
|
override suspend fun getAll(): Map<Id, RegisteredObject> = actionWrapper.wrap {
|
||||||
|
originalRepo.getAll()
|
||||||
|
}.onSuccess {
|
||||||
|
kvCache.actualizeAll(clear = true) { it }
|
||||||
|
}.getOrElse {
|
||||||
|
kvCache.getAll()
|
||||||
|
}
|
||||||
|
|
||||||
override suspend fun count(): Long = actionWrapper.wrap {
|
override suspend fun count(): Long = actionWrapper.wrap {
|
||||||
originalRepo.count()
|
originalRepo.count()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user