util: pass Servers by reference to serve()

This commit modifies nonBlockingGRPCServer.serve()
to accept Servers parameter by reference rather
than value to prevent copy of a large struct.

Signed-off-by: Rakshith R <rar@redhat.com>
This commit is contained in:
Rakshith R
2025-06-05 18:01:42 +05:30
committed by mergify[bot]
parent e2be707279
commit 3ff34e56b1

View File

@ -66,7 +66,7 @@ func (s *nonBlockingGRPCServer) Start(
middlewareConfig MiddlewareServerOptionConfig,
) {
s.wg.Add(1)
go s.serve(endpoint, *srv, middlewareConfig)
go s.serve(endpoint, srv, middlewareConfig)
}
// Wait blocks until the WaitGroup counter.
@ -86,7 +86,7 @@ func (s *nonBlockingGRPCServer) ForceStop() {
func (s *nonBlockingGRPCServer) serve(
endpoint string,
srv Servers,
srv *Servers,
middlewareConfig MiddlewareServerOptionConfig,
) {
proto, addr, err := parseEndpoint(endpoint)