Skip to content

Commit

Permalink
Use coursier thread pool to run coursier-related task
Browse files Browse the repository at this point in the history
Using the default global ExecutionContext, also used by the BSP server,
can lead to deadlocks, as coursier doesn't mark blocking things with
`blocking`.
  • Loading branch information
alexarchambault committed Sep 27, 2024
1 parent 4c3d2cb commit 34321e1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scalalib/src/mill/scalalib/CoursierModule.scala
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ trait CoursierModule extends mill.Module {
* The repositories used to resolved dependencies with [[resolveDeps()]].
*/
def repositoriesTask: Task[Seq[Repository]] = Task.Anon {
import scala.concurrent.ExecutionContext.Implicits.global
val resolve = Resolve()
val repos = Await.result(
Resolve().finalRepositories.future(),
resolve.finalRepositories.future()(resolve.cache.ec),
Duration.Inf
)
repos
Expand Down

0 comments on commit 34321e1

Please sign in to comment.