From 17ae1506f5e705c00d0f2ee0dfdcfc21b69a82f3 Mon Sep 17 00:00:00 2001 From: Benjamin Pracht Date: Sat, 25 Feb 2023 15:15:50 -0700 Subject: [PATCH] Chain twirpLogger and twirpRequestStatusHook properly for the Egress server (#1470) --- pkg/service/server.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/service/server.go b/pkg/service/server.go index 575794b2c..10c0f4ada 100644 --- a/pkg/service/server.go +++ b/pkg/service/server.go @@ -14,6 +14,7 @@ import ( "github.com/pion/turn/v2" "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/rs/cors" + "github.com/twitchtv/twirp" "github.com/urfave/negroni/v3" "go.uber.org/atomic" "golang.org/x/sync/errgroup" @@ -85,7 +86,12 @@ func NewLivekitServer(conf *config.Config, twirpLoggingHook := TwirpLogger(logger.GetLogger()) twirpRequestStatusHook := TwirpRequestStatusReporter() roomServer := livekit.NewRoomServiceServer(roomService, twirpLoggingHook) - egressServer := livekit.NewEgressServer(egressService, twirpLoggingHook, twirpRequestStatusHook) + egressServer := livekit.NewEgressServer(egressService, twirp.WithServerHooks( + twirp.ChainHooks( + twirpLoggingHook, + twirpRequestStatusHook, + ), + )) ingressServer := livekit.NewIngressServer(ingressService, twirpLoggingHook) mux := http.NewServeMux()