Skip to content

Commit f3858b2

Browse files
author
Sergey Mashkov
committed
Avoid magic constant
1 parent d1c4cad commit f3858b2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ktor-server/ktor-server-jetty/jvm/src/io/ktor/server/jetty/JettyKtorHandler.kt

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import io.ktor.util.pipeline.*
1313
import kotlinx.coroutines.*
1414
import org.eclipse.jetty.server.*
1515
import org.eclipse.jetty.server.handler.*
16-
import java.io.*
1716
import java.util.concurrent.*
1817
import java.util.concurrent.CancellationException
1918
import java.util.concurrent.atomic.*
@@ -25,6 +24,8 @@ private val JettyCallHandlerCoroutineName = CoroutineName("jetty-call-handler")
2524

2625
private val JettyKtorCounter = AtomicLong()
2726

27+
private const val THREAD_KEEP_ALIVE_TIME = 1L
28+
2829
internal class JettyKtorHandler(
2930
val environment: ApplicationEngineEnvironment,
3031
private val pipeline: () -> EnginePipeline,
@@ -36,7 +37,7 @@ internal class JettyKtorHandler(
3637
private val executor = ThreadPoolExecutor(
3738
configuration.callGroupSize,
3839
configuration.callGroupSize * 8,
39-
1L,
40+
THREAD_KEEP_ALIVE_TIME,
4041
TimeUnit.MINUTES,
4142
queue
4243
) { r ->

0 commit comments

Comments
 (0)