mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-03-28 01:35:06 +00:00
Replace http4s-blaze-client
with http4s-ember-client
.
This commit is contained in:
parent
64a46b382e
commit
438d1653c9
3
.gitignore
vendored
3
.gitignore
vendored
@ -27,3 +27,6 @@ _site/
|
||||
/website/site/templates/shortcodes/config.env.txt
|
||||
/docker/docs
|
||||
/docker/dev-log
|
||||
|
||||
.idea/*
|
||||
sbt.json
|
||||
|
@ -19,8 +19,8 @@ import docspell.store.Store
|
||||
import docspell.store.records.RInternalSetting
|
||||
|
||||
import org.http4s.HttpApp
|
||||
import org.http4s.blaze.client.BlazeClientBuilder
|
||||
import org.http4s.blaze.server.BlazeServerBuilder
|
||||
import org.http4s.ember.client.EmberClientBuilder
|
||||
import org.http4s.implicits._
|
||||
import org.http4s.server.Router
|
||||
import org.http4s.server.middleware.Logger
|
||||
@ -46,7 +46,7 @@ object JoexServer {
|
||||
pools.connectEC
|
||||
)
|
||||
settings <- Resource.eval(store.transact(RInternalSetting.create))
|
||||
httpClient <- BlazeClientBuilder[F].resource
|
||||
httpClient <- EmberClientBuilder.default[F].build
|
||||
pubSub <- NaivePubSub(
|
||||
cfg.pubSubConfig(settings.internalRouteKey),
|
||||
store,
|
||||
@ -64,7 +64,7 @@ object JoexServer {
|
||||
).orNotFound
|
||||
|
||||
// With Middlewares in place
|
||||
finalHttpApp = Logger.httpApp(false, false)(httpApp)
|
||||
finalHttpApp = Logger.httpApp(logHeaders = false, logBody = false)(httpApp)
|
||||
|
||||
} yield App(finalHttpApp, signal, exitCode)
|
||||
|
||||
|
@ -15,8 +15,8 @@ import docspell.scheduler.Task
|
||||
import docspell.store.Store
|
||||
import docspell.store.records._
|
||||
|
||||
import org.http4s.blaze.client.BlazeClientBuilder
|
||||
import org.http4s.client.Client
|
||||
import org.http4s.ember.client.EmberClientBuilder
|
||||
|
||||
object CheckNodesTask {
|
||||
def apply[F[_]: Async](
|
||||
@ -27,8 +27,7 @@ object CheckNodesTask {
|
||||
if (cfg.enabled)
|
||||
for {
|
||||
_ <- ctx.logger.info("Check nodes reachability")
|
||||
ec = scala.concurrent.ExecutionContext.global
|
||||
_ <- BlazeClientBuilder[F].withExecutionContext(ec).resource.use { client =>
|
||||
_ <- EmberClientBuilder.default[F].build.use { client =>
|
||||
checkNodes(ctx.logger, store, client)
|
||||
}
|
||||
_ <- ctx.logger.info(
|
||||
|
@ -12,9 +12,9 @@ import cats.implicits._
|
||||
import docspell.common.{Ident, LenientUri}
|
||||
import docspell.joexapi.model.{AddonSupport, BasicResult}
|
||||
|
||||
import org.http4s.blaze.client.BlazeClientBuilder
|
||||
import org.http4s.circe.CirceEntityDecoder
|
||||
import org.http4s.client.Client
|
||||
import org.http4s.ember.client.EmberClientBuilder
|
||||
import org.http4s.{Method, Request, Uri}
|
||||
|
||||
trait JoexClient[F[_]] {
|
||||
@ -73,5 +73,5 @@ object JoexClient {
|
||||
}
|
||||
|
||||
def resource[F[_]: Async]: Resource[F, JoexClient[F]] =
|
||||
BlazeClientBuilder[F].resource.map(apply[F])
|
||||
EmberClientBuilder.default[F].build.map(apply[F])
|
||||
}
|
||||
|
@ -30,7 +30,8 @@ sealed trait Channel {
|
||||
}
|
||||
|
||||
object Channel {
|
||||
implicit val jsonConfig = Configuration.default.withDiscriminator("channelType")
|
||||
implicit val jsonConfig: Configuration =
|
||||
Configuration.default.withDiscriminator("channelType")
|
||||
|
||||
final case class Mail(
|
||||
id: Ident,
|
||||
@ -38,7 +39,7 @@ object Channel {
|
||||
connection: Ident,
|
||||
recipients: Nel[MailAddress]
|
||||
) extends Channel {
|
||||
val channelType = ChannelType.Mail
|
||||
val channelType: ChannelType = ChannelType.Mail
|
||||
def fold[A](
|
||||
f1: Mail => A,
|
||||
f2: Gotify => A,
|
||||
@ -85,7 +86,7 @@ object Channel {
|
||||
roomId: String,
|
||||
accessToken: Password
|
||||
) extends Channel {
|
||||
val channelType = ChannelType.Matrix
|
||||
val channelType: ChannelType = ChannelType.Matrix
|
||||
def fold[A](
|
||||
f1: Mail => A,
|
||||
f2: Gotify => A,
|
||||
@ -101,7 +102,7 @@ object Channel {
|
||||
|
||||
final case class Http(id: Ident, name: Option[String], url: LenientUri)
|
||||
extends Channel {
|
||||
val channelType = ChannelType.Http
|
||||
val channelType: ChannelType = ChannelType.Http
|
||||
def fold[A](
|
||||
f1: Mail => A,
|
||||
f2: Gotify => A,
|
||||
|
@ -24,9 +24,9 @@ import docspell.store.Store
|
||||
import docspell.store.records.RInternalSetting
|
||||
|
||||
import org.http4s._
|
||||
import org.http4s.blaze.client.BlazeClientBuilder
|
||||
import org.http4s.blaze.server.BlazeServerBuilder
|
||||
import org.http4s.dsl.Http4sDsl
|
||||
import org.http4s.ember.client.EmberClientBuilder
|
||||
import org.http4s.headers.Location
|
||||
import org.http4s.implicits._
|
||||
import org.http4s.server.Router
|
||||
@ -83,7 +83,7 @@ object RestServer {
|
||||
(RestApp[F], NaivePubSub[F], RInternalSetting)
|
||||
] =
|
||||
for {
|
||||
httpClient <- BlazeClientBuilder[F].resource
|
||||
httpClient <- EmberClientBuilder.default[F].build
|
||||
store <- Store.create[F](
|
||||
cfg.backend.jdbc,
|
||||
cfg.backend.databaseSchema,
|
||||
|
@ -239,7 +239,7 @@ object Dependencies {
|
||||
val fs2 = fs2Core ++ fs2Io
|
||||
|
||||
val http4sClient = Seq(
|
||||
"org.http4s" %% "http4s-blaze-client" % "0.23.14"
|
||||
"org.http4s" %% "http4s-ember-client" % Http4sVersion
|
||||
)
|
||||
|
||||
val http4sCirce = Seq(
|
||||
|
Loading…
x
Reference in New Issue
Block a user