aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2025-06-26 20:02:50 +0200
committerLinnea Gräf <nea@nea.moe>2025-06-26 20:02:50 +0200
commit04fd3b66df7184db37df3306876bac8f95f8e71a (patch)
tree168d0c5bb99e4d7211541243d434269443f67618
parent1ae6a259609c29d353a2e7856739b6e2047e3ccc (diff)
downloadFirmament-04fd3b66df7184db37df3306876bac8f95f8e71a.tar.gz
Firmament-04fd3b66df7184db37df3306876bac8f95f8e71a.tar.bz2
Firmament-04fd3b66df7184db37df3306876bac8f95f8e71a.zip
fix: Pegging all cores to the max on repo reload
-rw-r--r--src/main/kotlin/repo/ItemCache.kt8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main/kotlin/repo/ItemCache.kt b/src/main/kotlin/repo/ItemCache.kt
index 3518257..14decd8 100644
--- a/src/main/kotlin/repo/ItemCache.kt
+++ b/src/main/kotlin/repo/ItemCache.kt
@@ -253,7 +253,13 @@ object ItemCache : IReloadable {
isFlawless = true
if (TestUtil.isInTest) return
val newScope =
- CoroutineScope(Firmament.coroutineScope.coroutineContext + SupervisorJob(Firmament.globalJob) + Dispatchers.Default)
+ CoroutineScope(
+ Firmament.coroutineScope.coroutineContext +
+ SupervisorJob(Firmament.globalJob) +
+ Dispatchers.Default.limitedParallelism(
+ (Runtime.getRuntime().availableProcessors() / 4).coerceAtLeast(1)
+ )
+ )
val items = repository.items?.items
newScope.launch {
val items = items ?: return@launch