fix build

This commit is contained in:
2025-03-03 12:15:36 +06:00
parent 7a650f5c2f
commit ddb8e1efb4
3 changed files with 9 additions and 9 deletions

View File

@@ -62,7 +62,7 @@ open class KeyValueCacheRepo<Key,Value>(
kvCache: KVCache<Key, Value>,
scope: CoroutineScope = CoroutineScope(Dispatchers.Default),
locker: SmartRWLocker = SmartRWLocker(),
) : ReadKeyValueCacheRepo<Key,Value>(kvRepo, kvCache, locker), KeyValueRepo<Key,Value>, WriteKeyValueRepo<Key, Value> by parentRepo, CommonCacheRepo {
) : ReadKeyValueCacheRepo<Key,Value>(kvRepo, kvCache, locker), KeyValueRepo<Key,Value>, WriteKeyValueRepo<Key, Value> by kvRepo, CommonCacheRepo {
protected val onNewJob = kvRepo.onNewValue.onEach {
locker.withWriteLock {
kvCache.set(it.first, it.second)

View File

@@ -8,21 +8,21 @@ import kotlinx.coroutines.CoroutineScope
import kotlin.time.Duration.Companion.seconds
open class AutoRecacheKeyValueRepo<Id, RegisteredObject>(
override val originalRepo: KeyValueRepo<Id, RegisteredObject>,
protected val kvRepo: KeyValueRepo<Id, RegisteredObject>,
scope: CoroutineScope,
kvCache: KeyValueRepo<Id, RegisteredObject> = MapKeyValueRepo(),
recacheDelay: Long = 60.seconds.inWholeMilliseconds,
actionWrapper: ActionWrapper = ActionWrapper.Direct,
idGetter: (RegisteredObject) -> Id
) : AutoRecacheReadKeyValueRepo<Id, RegisteredObject> (
originalRepo,
kvRepo,
scope,
kvCache,
recacheDelay,
actionWrapper,
idGetter
),
WriteKeyValueRepo<Id, RegisteredObject> by AutoRecacheWriteKeyValueRepo(originalRepo, scope, kvCache),
WriteKeyValueRepo<Id, RegisteredObject> by AutoRecacheWriteKeyValueRepo(kvRepo, scope, kvCache),
KeyValueRepo<Id, RegisteredObject> {
constructor(
@@ -34,14 +34,14 @@ open class AutoRecacheKeyValueRepo<Id, RegisteredObject>(
idGetter: (RegisteredObject) -> Id
) : this(originalRepo, scope, kvCache, recacheDelay, ActionWrapper.Timeouted(originalCallTimeoutMillis), idGetter)
override suspend fun unsetWithValues(toUnset: List<RegisteredObject>) = originalRepo.unsetWithValues(
override suspend fun unsetWithValues(toUnset: List<RegisteredObject>) = kvRepo.unsetWithValues(
toUnset
).also {
kvCache.unsetWithValues(toUnset)
}
override suspend fun clear() {
originalRepo.clear()
kvRepo.clear()
kvCache.clear()
}
}

View File

@@ -9,19 +9,19 @@ import kotlinx.coroutines.CoroutineScope
import kotlin.time.Duration.Companion.seconds
open class AutoRecacheKeyValuesRepo<Id, RegisteredObject>(
override val originalRepo: KeyValuesRepo<Id, RegisteredObject>,
protected val kvsRepo: KeyValuesRepo<Id, RegisteredObject>,
scope: CoroutineScope,
kvCache: KeyValueRepo<Id, List<RegisteredObject>> = MapKeyValueRepo(),
recacheDelay: Long = 60.seconds.inWholeMilliseconds,
actionWrapper: ActionWrapper = ActionWrapper.Direct
) : AutoRecacheReadKeyValuesRepo<Id, RegisteredObject> (
originalRepo,
kvsRepo,
scope,
kvCache,
recacheDelay,
actionWrapper
),
WriteKeyValuesRepo<Id, RegisteredObject> by AutoRecacheWriteKeyValuesRepo(originalRepo, scope, kvCache),
WriteKeyValuesRepo<Id, RegisteredObject> by AutoRecacheWriteKeyValuesRepo(kvsRepo, scope, kvCache),
KeyValuesRepo<Id, RegisteredObject> {
constructor(