Skip to content

Commit

Permalink
feature: add interceptor lab
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Ou authored and 歐川銘 committed Mar 27, 2024
1 parent 93240f0 commit 77428d6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/comment/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ func runAPI(_ *cobra.Command, _ []string) error {
}
}()

return runkit.GracefulRun(serveGRPC(lis, svc, logger, grpc.UnaryInterceptor(meter.UnaryServerInterceptor())), &args.GracefulConfig)
// add interceptor here to update metrics
// TODO
return runkit.GracefulRun(serveGRPC(lis, svc, logger), &args.GracefulConfig)
}

func serveGRPC(lis net.Listener, svc pb.CommentServer, logger *logkit.Logger, opt ...grpc.ServerOption) runkit.GracefulRunFunc {
Expand Down

0 comments on commit 77428d6

Please sign in to comment.