Skip to content

Commit

Permalink
move port resolution out of use block
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-klass committed Jan 20, 2025
1 parent 2c58501 commit 3fe8b8e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ trait TestServerInterpreter[F[_], +R, OPTIONS, ROUTE] {
): Resource[IO, (Port, KillSwitch)] = for {
stopSignal <- Resource.eval(Deferred[IO, Unit])
portValue <- Resource.eval(Deferred[IO, Port])
_ <- server(routes, gracefulShutdownTimeout).use(port => portValue.complete(port) *> stopSignal.get).background
_ <- server(routes, gracefulShutdownTimeout).evalMap(portValue.complete).use(_ => stopSignal.get).background
port <- Resource.eval(portValue.get)
} yield (port, stopSignal.complete(()).void)

Expand Down

0 comments on commit 3fe8b8e

Please sign in to comment.