mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 18:53:35 +00:00
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:
@ -66,7 +66,7 @@ func (s *nonBlockingGRPCServer) Start(
|
|||||||
middlewareConfig MiddlewareServerOptionConfig,
|
middlewareConfig MiddlewareServerOptionConfig,
|
||||||
) {
|
) {
|
||||||
s.wg.Add(1)
|
s.wg.Add(1)
|
||||||
go s.serve(endpoint, *srv, middlewareConfig)
|
go s.serve(endpoint, srv, middlewareConfig)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Wait blocks until the WaitGroup counter.
|
// Wait blocks until the WaitGroup counter.
|
||||||
@ -86,7 +86,7 @@ func (s *nonBlockingGRPCServer) ForceStop() {
|
|||||||
|
|
||||||
func (s *nonBlockingGRPCServer) serve(
|
func (s *nonBlockingGRPCServer) serve(
|
||||||
endpoint string,
|
endpoint string,
|
||||||
srv Servers,
|
srv *Servers,
|
||||||
middlewareConfig MiddlewareServerOptionConfig,
|
middlewareConfig MiddlewareServerOptionConfig,
|
||||||
) {
|
) {
|
||||||
proto, addr, err := parseEndpoint(endpoint)
|
proto, addr, err := parseEndpoint(endpoint)
|
||||||
|
Reference in New Issue
Block a user