mirror of https://github.com/sbt/sbt.git
Merge pull request #278 from eed3si9n/wip/thread-pool
Use fixed thread pool
This commit is contained in:
commit
4a0a6c77bc
|
|
@ -19,8 +19,12 @@ private[ivyint] case class DownloadResult(dep: IvyNode,
|
||||||
totalSizeDownloaded: Long)
|
totalSizeDownloaded: Long)
|
||||||
|
|
||||||
object ParallelResolveEngine {
|
object ParallelResolveEngine {
|
||||||
private val resolveExecutionContext =
|
private lazy val resolveExecutionContext: ExecutionContext = {
|
||||||
ExecutionContext.fromExecutor(Executors.newCachedThreadPool())
|
// This throttles the connection number, especially when Gigahorse is not used.
|
||||||
|
val maxConnectionCount = 6
|
||||||
|
val executor = Executors.newFixedThreadPool(maxConnectionCount)
|
||||||
|
ExecutionContext.fromExecutor(executor)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Define an ivy [[ResolveEngine]] that resolves dependencies in parallel. */
|
/** Define an ivy [[ResolveEngine]] that resolves dependencies in parallel. */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue