Skip to content

Commit

Permalink
Disable netty's LeakDetection by default (#2288)
Browse files Browse the repository at this point in the history
  • Loading branch information
kyri-petrou authored Jun 17, 2024
1 parent ddaa1ac commit 68ee2a4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion adapters/quick/src/main/scala/caliban/QuickAdapter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package caliban
import caliban.Configurator.ExecutionConfiguration
import zio._
import zio.http._
import zio.http.netty.NettyConfig
import zio.http.netty.NettyConfig.LeakDetectionLevel
import zio.stacktracer.TracingImplicits.disableAutoTrace

final class QuickAdapter[R] private (requestHandler: QuickRequestHandler[R]) {
Expand Down Expand Up @@ -80,7 +82,11 @@ final class QuickAdapter[R] private (requestHandler: QuickRequestHandler[R]) {
)(implicit trace: Trace, tag: Tag[R]): RIO[R, Nothing] =
Server
.serve[R](routes(apiPath, graphiqlPath = graphiqlPath, uploadPath = uploadPath, webSocketPath = webSocketPath))
.provideSomeLayer[R](Server.defaultWithPort(port))
.provideSomeLayer[R](
ZLayer.succeed(Server.Config.default.port(port))
++ ZLayer.succeed(NettyConfig.default.leakDetection(LeakDetectionLevel.DISABLED))
>+> Server.customized
)

def configure(config: ExecutionConfiguration)(implicit trace: Trace): QuickAdapter[R] =
new QuickAdapter(requestHandler.configure(config))
Expand Down

0 comments on commit 68ee2a4

Please sign in to comment.