From 9bee0f47af7fc1f1daddaa7a5ee52d0aacb3420e Mon Sep 17 00:00:00 2001 From: Roman Timushev Date: Mon, 30 May 2022 01:10:43 +0200 Subject: [PATCH] Extract versions from maven central html listing --- .../sbt/updates/metadata/CompoundMetadataLoader.scala | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/scala/com/timushev/sbt/updates/metadata/CompoundMetadataLoader.scala b/src/main/scala/com/timushev/sbt/updates/metadata/CompoundMetadataLoader.scala index 68fd393d..fa3fbf2a 100644 --- a/src/main/scala/com/timushev/sbt/updates/metadata/CompoundMetadataLoader.scala +++ b/src/main/scala/com/timushev/sbt/updates/metadata/CompoundMetadataLoader.scala @@ -7,9 +7,11 @@ import scala.concurrent.Future class CompoundMetadataLoader(loaders: Seq[MetadataLoader]) extends MetadataLoader { override def getVersions(module: sbt.ModuleID): Future[Seq[Version]] = - loaders.foldLeft(Future.failed[Seq[Version]](new NoSuchElementException)) { (result, loader) => - result.recoverWith { case _ => - loader.getVersions(module) + Future + .sequence { + loaders.map { loader => + loader.getVersions(module).recover { case _ => Seq.empty } + } } - } + .map(_.flatten) }