mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-12-18 14:47:15 +00:00
Update AutoRecacheReadKeyValuesRepo.kt
This commit is contained in:
parent
b64f2e6d32
commit
681c13144a
@ -14,6 +14,7 @@ import dev.inmo.micro_utils.repos.ReadKeyValuesRepo
|
||||
import dev.inmo.micro_utils.repos.cache.cache.FullKVCache
|
||||
import dev.inmo.micro_utils.repos.cache.fallback.ActionWrapper
|
||||
import dev.inmo.micro_utils.repos.cache.util.actualizeAll
|
||||
import dev.inmo.micro_utils.repos.cache.FallbackCacheRepo
|
||||
import dev.inmo.micro_utils.repos.set
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.delay
|
||||
@ -28,7 +29,7 @@ open class AutoRecacheReadKeyValuesRepo<Id, RegisteredObject>(
|
||||
protected val recacheDelay: Long = 60.seconds.inWholeMilliseconds,
|
||||
protected val actionWrapper: ActionWrapper = ActionWrapper.Direct,
|
||||
protected val idGetter: (RegisteredObject) -> Id
|
||||
) : ReadKeyValuesRepo<Id, RegisteredObject> {
|
||||
) : ReadKeyValuesRepo<Id, RegisteredObject>, FallbackCacheRepo {
|
||||
val autoUpdateJob = scope.launch {
|
||||
while (isActive) {
|
||||
runCatchingSafely {
|
||||
|
Loading…
Reference in New Issue
Block a user