mirror of
https://github.com/mii443/prometheus-android-exporter.git
synced 2025-08-22 15:15:35 +00:00
limit parallelism
This commit is contained in:
@ -64,8 +64,8 @@ class PromWorker(
|
|||||||
|
|
||||||
@OptIn(DelicateCoroutinesApi::class, ExperimentalCoroutinesApi::class)
|
@OptIn(DelicateCoroutinesApi::class, ExperimentalCoroutinesApi::class)
|
||||||
private suspend fun startServicesInOneThread(config: PromConfiguration) {
|
private suspend fun startServicesInOneThread(config: PromConfiguration) {
|
||||||
val backgroundDispatcher = newFixedThreadPoolContext(2, "Prom worker")
|
val backgroundDispatcher = newFixedThreadPoolContext(1, "Prom worker")
|
||||||
val threadContext = backgroundDispatcher.limitedParallelism(2)
|
val threadContext = backgroundDispatcher.limitedParallelism(1)
|
||||||
|
|
||||||
try{
|
try{
|
||||||
withContext(threadContext) {
|
withContext(threadContext) {
|
||||||
|
Reference in New Issue
Block a user