mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-11-22 16:23:50 +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)
|
||||
}
|
||||
|
||||
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()
|
||||
|
Loading…
Reference in New Issue
Block a user