mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2025-09-17 06:23:19 +00:00
fixes in AutoRecacheReadKeyValueRepo
This commit is contained in:
@@ -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()
|
||||||
|
Reference in New Issue
Block a user