Skip to content

Commit 0bc8f57

Browse files
authored
Set WebApp.scala shutdown timeout to zero (com-lihaoyi#4798)
Otherwise it hangs for 30s when you try to kill the process, which slows down iterative development considerably
1 parent e6d04a2 commit 0bc8f57

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

example/scalalib/web/3-todo-http4s/src/WebApp.scala

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package webapp
22

3+
import scala.concurrent.duration.Duration
34
import scalatags.Text.all._
45
import scalatags.Text.tags2
56
import cats.effect._
@@ -17,7 +18,12 @@ object WebApp extends IOApp.Simple {
1718
case class Todo(checked: Boolean, text: String)
1819

1920
def run = mkService.toResource.flatMap { service =>
20-
EmberServerBuilder.default[IO].withHttpApp(service).withPort(port"8084").build
21+
EmberServerBuilder
22+
.default[IO]
23+
.withHttpApp(service)
24+
.withPort(port"8084")
25+
.withShutdownTimeout(Duration.Zero)
26+
.build
2127
}.useForever
2228

2329
def mkService =

0 commit comments

Comments
 (0)