Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
AriaMoradi committed May 17, 2021
1 parent 9d38f47 commit 083996a
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +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.future.future
import kotlinx.coroutines.newFixedThreadPoolContext
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

/*
Expand All @@ -55,8 +56,7 @@ import kotlin.concurrent.thread
object JavalinSetup {
private val logger = KotlinLogging.logger {}

@kotlinx.coroutines.ObsoleteCoroutinesApi
private val scope = CoroutineScope(newFixedThreadPoolContext(200, "javalin-future"))
private val scope = CoroutineScope(Executors.newFixedThreadPool(200).asCoroutineDispatcher())

private fun <T> future(block: suspend CoroutineScope.() -> T): CompletableFuture<T> {
return scope.future(block = block)
Expand Down

0 comments on commit 083996a

Please sign in to comment.