Skip to content

Commit

Permalink
perf: update rule data in default thread
Browse files Browse the repository at this point in the history
  • Loading branch information
lisonge committed Jun 8, 2024
1 parent 75797a8 commit 9f0f026
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/src/main/kotlin/li/songe/gkd/util/SubsState.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.SharingStarted
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.flowOn
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.stateIn
import kotlinx.coroutines.flow.update
Expand Down Expand Up @@ -292,7 +293,7 @@ val ruleSummaryFlow by lazy {
appIdToAllGroups = appAllGroups.mapValues { e -> e.value.toImmutableList() }
.toImmutableMap()
)
}.stateIn(appScope, SharingStarted.Eagerly, RuleSummary())
}.flowOn(Dispatchers.Default).stateIn(appScope, SharingStarted.Eagerly, RuleSummary())
}

private fun loadSubs(id: Long): RawSubscription {
Expand Down

0 comments on commit 9f0f026

Please sign in to comment.