mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-22 02:18:26 +00:00
Replace http4s-blaze-server
with http4s-ember-server
.
This commit is contained in:
@ -27,6 +27,8 @@ import docspell.pubsub.naive.PubSubConfig
|
||||
import docspell.scheduler.{PeriodicSchedulerConfig, SchedulerConfig}
|
||||
import docspell.store.{JdbcConfig, SchemaMigrateConfig}
|
||||
|
||||
import com.comcast.ip4s.{Host, Port}
|
||||
|
||||
case class Config(
|
||||
appId: Ident,
|
||||
baseUrl: LenientUri,
|
||||
@ -59,7 +61,7 @@ case class Config(
|
||||
}
|
||||
|
||||
object Config {
|
||||
case class Bind(address: String, port: Int)
|
||||
case class Bind(address: Host, port: Port)
|
||||
|
||||
case class ScanMailbox(maxFolders: Int, mailChunkSize: Int, maxMails: Int) {
|
||||
def mailBatchSize: Int =
|
||||
|
@ -18,6 +18,7 @@ import emil.MailAddress
|
||||
import emil.javamail.syntax._
|
||||
import pureconfig._
|
||||
import pureconfig.generic.auto._
|
||||
import pureconfig.module.ip4s._
|
||||
import yamusca.imports._
|
||||
|
||||
object ConfigFile {
|
||||
|
@ -6,7 +6,6 @@
|
||||
|
||||
package docspell.joex
|
||||
|
||||
import cats.effect.Ref
|
||||
import cats.effect._
|
||||
import fs2.Stream
|
||||
import fs2.concurrent.SignallingRef
|
||||
@ -19,8 +18,8 @@ import docspell.store.Store
|
||||
import docspell.store.records.RInternalSetting
|
||||
|
||||
import org.http4s.HttpApp
|
||||
import org.http4s.blaze.server.BlazeServerBuilder
|
||||
import org.http4s.ember.client.EmberClientBuilder
|
||||
import org.http4s.ember.server.EmberServerBuilder
|
||||
import org.http4s.implicits._
|
||||
import org.http4s.server.Router
|
||||
import org.http4s.server.middleware.Logger
|
||||
@ -70,13 +69,15 @@ object JoexServer {
|
||||
|
||||
Stream
|
||||
.resource(app)
|
||||
.flatMap(app =>
|
||||
BlazeServerBuilder[F]
|
||||
.bindHttp(cfg.bind.port, cfg.bind.address)
|
||||
.withHttpApp(app.httpApp)
|
||||
.withoutBanner
|
||||
.serveWhile(app.termSig, app.exitRef)
|
||||
)
|
||||
|
||||
.flatMap { app =>
|
||||
Stream.resource {
|
||||
EmberServerBuilder
|
||||
.default[F]
|
||||
.withHost(cfg.bind.address)
|
||||
.withPort(cfg.bind.port)
|
||||
.withHttpApp(app.httpApp)
|
||||
.build
|
||||
}
|
||||
}
|
||||
}.drain
|
||||
}
|
||||
|
Reference in New Issue
Block a user