Migrate from Blaze to Ember

This commit is contained in:
Guntis Smaukstelis
2023-05-17 01:20:01 +03:00
parent 590757183a
commit affc2e0d93
5 changed files with 44 additions and 27 deletions
+2 -2
View File
@@ -3,9 +3,9 @@ package fetch
import cats.effect._
import cats.implicits._
import org.http4s._
import org.http4s.blaze.client.BlazeClientBuilder
import org.http4s.client.Client
import org.http4s.headers.Authorization
import org.http4s.ember.client.EmberClientBuilder
import pureconfig._
import pureconfig.generic.auto._
@@ -45,7 +45,7 @@ object FetchService {
private def fetchFiles(fileNames: List[String]): IO[List[Either[Throwable, (String, String)]]] = {
val IOUrls = baseUrl.map(baseUrl => fileNames.map(baseUrl / _))
BlazeClientBuilder[IO](global).resource.use { client =>
EmberClientBuilder.default[IO].build.use { client =>
IOUrls.flatMap(_.traverse(url => makeRequest(client, url)))
}
}