From fa345af42db1afa6cc7c3f763a12bee1a8a23966 Mon Sep 17 00:00:00 2001 From: Aria Moradi Date: Tue, 18 May 2021 00:43:32 +0430 Subject: [PATCH] use Dispatchers.IO --- .../main/kotlin/ir/armor/tachidesk/server/JavalinSetup.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/src/main/kotlin/ir/armor/tachidesk/server/JavalinSetup.kt b/server/src/main/kotlin/ir/armor/tachidesk/server/JavalinSetup.kt index d2a0e5f5..7b0a1a4a 100644 --- a/server/src/main/kotlin/ir/armor/tachidesk/server/JavalinSetup.kt +++ b/server/src/main/kotlin/ir/armor/tachidesk/server/JavalinSetup.kt @@ -36,14 +36,14 @@ import ir.armor.tachidesk.impl.backup.legacy.LegacyBackupImport.restoreLegacyBac import ir.armor.tachidesk.server.internal.About.getAbout import ir.armor.tachidesk.server.util.openInBrowser import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.asCoroutineDispatcher +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.SupervisorJob import kotlinx.coroutines.future.future import mu.KotlinLogging import java.io.IOException import java.text.SimpleDateFormat import java.util.Date import java.util.concurrent.CompletableFuture -import java.util.concurrent.Executors import kotlin.concurrent.thread /* @@ -56,7 +56,7 @@ import kotlin.concurrent.thread object JavalinSetup { private val logger = KotlinLogging.logger {} - private val scope = CoroutineScope(Executors.newFixedThreadPool(200).asCoroutineDispatcher()) + private val scope = CoroutineScope(SupervisorJob() + Dispatchers.IO) private fun future(block: suspend CoroutineScope.() -> T): CompletableFuture { return scope.future(block = block)