Fix http server startup

Closes: #2358
This commit is contained in:
eikek
2023-11-06 23:43:31 +01:00
parent 2ce6536d0b
commit a9b0c0e086
3 changed files with 65 additions and 27 deletions

View File

@ -14,6 +14,7 @@ import fs2.io.net.Network
import docspell.backend.msg.Topics
import docspell.common.Pools
import docspell.common.util.ResourceUse.Implicits._
import docspell.joex.routes._
import docspell.pubsub.naive.NaivePubSub
import docspell.store.Store
@ -74,15 +75,14 @@ object JoexServer {
Stream
.resource(app)
.flatMap { app =>
Stream.resource {
EmberServerBuilder
.default[F]
.withHost(cfg.bind.address)
.withPort(cfg.bind.port)
.withHttpApp(app.httpApp)
.build
}
.evalMap { app =>
EmberServerBuilder
.default[F]
.withHost(cfg.bind.address)
.withPort(cfg.bind.port)
.withHttpApp(app.httpApp)
.build
.useUntil(app.termSig, app.exitRef)
}
}.drain
}