Skip to content

Commit

Permalink
enable in memory db again
Browse files Browse the repository at this point in the history
  • Loading branch information
augustocdias committed Dec 5, 2023
1 parent 8d9e781 commit 429471c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ fun coreLogic(
encryptProteusStorage = true,
isMLSSupportEnabled = true,
wipeOnDeviceRemoval = true,
), userAgent = "Wire Infinite Monkeys", useInMemoryStorage = false
), userAgent = "Wire Infinite Monkeys", useInMemoryStorage = true
)
coreLogic.updateApiVersionsScheduler.scheduleImmediateApiVersionUpdate()
return coreLogic
Expand Down
15 changes: 10 additions & 5 deletions monkeys/src/main/kotlin/com/wire/kalium/monkeys/pool/MonkeyPool.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ import com.wire.kalium.monkeys.importer.Team
import com.wire.kalium.monkeys.importer.UserCount
import com.wire.kalium.monkeys.importer.UserData
import io.micrometer.core.instrument.Tag
import kotlinx.coroutines.async
import kotlinx.coroutines.awaitAll
import kotlinx.coroutines.coroutineScope
import java.util.concurrent.ConcurrentHashMap
import kotlin.math.roundToInt

Expand Down Expand Up @@ -67,12 +70,14 @@ class MonkeyPool(users: List<UserData>, testCase: String) {
}
}

suspend fun warmUp(core: CoreLogic) {
suspend fun warmUp(core: CoreLogic) = coroutineScope {
// this is needed to create key packages for clients at least once
poolById.values.forEach {
it.login(core) {}
it.logout {}
}
poolById.values.map {
async {
it.login(core) {}
it.logout {}
}
}.awaitAll()
}

fun randomMonkeysFromTeam(team: String, userCount: UserCount): List<Monkey> {
Expand Down

0 comments on commit 429471c

Please sign in to comment.