fix: Pegging all cores to the max on repo reload
This commit is contained in:
@@ -253,7 +253,13 @@ object ItemCache : IReloadable {
|
|||||||
isFlawless = true
|
isFlawless = true
|
||||||
if (TestUtil.isInTest) return
|
if (TestUtil.isInTest) return
|
||||||
val newScope =
|
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
|
val items = repository.items?.items
|
||||||
newScope.launch {
|
newScope.launch {
|
||||||
val items = items ?: return@launch
|
val items = items ?: return@launch
|
||||||
|
|||||||
Reference in New Issue
Block a user