Skip to content

Commit

Permalink
Change Server to a while loop to detect issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mikolajkapica committed Jun 22, 2024
1 parent 3afd7e7 commit 41a7f99
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions api/src/main/scala/Server.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,23 @@ import scala.concurrent.duration.Duration
object Server {

def run() =
implicit val system = ActorSystem(Behaviors.empty, "my-system")
implicit val executionContext = system.executionContext
val keepAlive = Promise[Unit].future

val host = "0.0.0.0"
val port = 8080

val bindingFuture = Http()
.newServerAt(host, port)
.bind(Routes.route)

while (true) {
println("Hello, world!")
Thread.sleep(1000)
}
// implicit val system = ActorSystem(Behaviors.empty, "my-system")
// implicit val executionContext = system.executionContext
// val keepAlive = Promise[Unit].future
//
// val host = "0.0.0.0"
// val port = 8080
//
// val bindingFuture = Http()
// .newServerAt(host, port)
// .bind(Routes.route)
//
// Database.test()

Await.result(keepAlive, Duration.Inf)
//
// Await.result(keepAlive, Duration.Inf)

}

0 comments on commit 41a7f99

Please sign in to comment.