Revert "Ensure a same artifact isn't downloaded twice in the same iteration"

This reverts commit d437cfb87d.
This commit is contained in:
Alexandre Archambault 2017-07-03 12:56:34 +02:00
parent ed1e41baf9
commit 2929c47652
1 changed files with 2 additions and 18 deletions

View File

@ -64,22 +64,6 @@ final case class Missing(
cont: Resolution => ResolutionProcess
) extends ResolutionProcess {
def uniqueModules: Missing = {
// only try to fetch a single version of a given module in a same iteration, so that resolutions for different
// versions don't try to download the same URL in the same iteration, which the coursier.Cache.Logger API doesn't
// allow
val missing0 = missing.groupBy(_._1).toSeq.map(_._2).map {
case Seq(v) => v
case Seq() => sys.error("Cannot happen")
case v =>
v.maxBy { case (_, v0) => Version(v0) }
}
copy(missing = missing0)
}
def next(results: Fetch.MD): ResolutionProcess = {
val errors = results.collect {
@ -136,7 +120,7 @@ final case class Missing(
Continue(res0, cont)
} else
Missing(depMgmtMissing.toSeq, res, cont0).uniqueModules
Missing(depMgmtMissing.toSeq, res, cont0)
}
val current0 = current.copyWithCache(
@ -174,7 +158,7 @@ object ResolutionProcess {
if (resolution0.isDone)
Done(resolution0)
else
Missing(resolution0.missingFromCache.toSeq, resolution0, apply).uniqueModules
Missing(resolution0.missingFromCache.toSeq, resolution0, apply)
}
}