Update http4s to 0.23.6

This commit is contained in:
eikek
2021-10-24 18:24:03 +02:00
parent cd0f7ec66e
commit 48d2bec9c4
12 changed files with 22 additions and 45 deletions

View File

@ -55,12 +55,7 @@ object Main extends IOApp {
cfg.baseUrl,
Some(cfg.fullTextSearch.solr.url).filter(_ => cfg.fullTextSearch.enabled)
)
val pools = for {
cec <- connectEC
bec <- blockingEC
rec <- restserverEC
} yield Pools(cec, bec, rec)
val pools = connectEC.map(Pools.apply)
logger.info(s"\n${banner.render("***>")}")
if (EnvMode.current.isDev) {
logger.warn(">>>>> Docspell is running in DEV mode! <<<<<")

View File

@ -32,11 +32,10 @@ object RestAppImpl {
def create[F[_]: Async](
cfg: Config,
connectEC: ExecutionContext,
httpClientEc: ExecutionContext
connectEC: ExecutionContext
): Resource[F, RestApp[F]] =
for {
backend <- BackendApp(cfg.backend, connectEC, httpClientEc)(
backend <- BackendApp(cfg.backend, connectEC)(
createFtsClient[F](cfg)
)
app = new RestAppImpl[F](cfg, backend)

View File

@ -34,10 +34,8 @@ object RestServer {
val templates = TemplateRoutes[F](cfg)
val app = for {
restApp <-
RestAppImpl
.create[F](cfg, pools.connectEC, pools.httpClientEC)
httpClient <- BlazeClientBuilder[F](pools.httpClientEC).resource
restApp <- RestAppImpl.create[F](cfg, pools.connectEC)
httpClient <- BlazeClientBuilder[F].resource
httpApp = Router(
"/api/info" -> routes.InfoRoutes(),
"/api/v1/open/" -> openRoutes(cfg, httpClient, restApp),
@ -64,7 +62,7 @@ object RestServer {
Stream
.resource(app)
.flatMap(httpApp =>
BlazeServerBuilder[F](pools.restEC)
BlazeServerBuilder[F]
.bindHttp(cfg.bind.port, cfg.bind.address)
.withHttpApp(httpApp)
.withoutBanner