mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2026-10-29 08:03:05 +00:00
fixes in AutoRecacheReadKeyValueRepo
This commit is contained in:
1 parent
5180d6fc3e
commit
022297ad3f
1 file changed
+7
-1
+7
-1
@@ -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