small change in MapWriteKeyValuesRepo.set and remove duration of FullKeyValuesCacheRepoTests.creatingWorksProperly

This commit is contained in:
InsanusMokrassar committed 2024-08-07 16:50:13 +06:00
1 parent ea82a59f31
commit 8713fb04c5
2 files changed
+4 -4

No files matched your search

@@ -10,7 +10,7 @@ import kotlin.test.*
class FullKeyValuesCacheRepoTests {
@Test
fun creatingWorksProperly() = runTest(timeout = 1.days) {
fun creatingWorksProperly() = runTest {
val testData = (0 until 1000).associate {
("$it-" + uuid4().toString()) to (0 until 1000).map {
"$it-" + uuid4().toString()
@@ -110,9 +110,9 @@ class MapWriteKeyValuesRepo<Key, Value>(
override suspend fun set(toSet: Map<Key, List<Value>>) {
locker.withWriteLock {
toSet.forEach {
map[it.key] = it.value.toMutableList()
}
map.putAll(
toSet.mapValues { it.value.toMutableList() }
)
}
toSet.forEach { (k, v) ->
v.forEach {