mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2025-09-15 21:39:24 +00:00
fixes in AutoRecacheReadKeyValueRepo
This commit is contained in:
@@ -52,7 +52,13 @@ open class AutoRecacheReadKeyValueRepo<Id, RegisteredObject>(
|
||||
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 {
|
||||
originalRepo.count()
|
||||
|
Reference in New Issue
Block a user