mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 18:53:35 +00:00
util: pass Servers by reference to Start()
This commit modifies nonBlockingGRPCServer.Start() 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:
@ -31,7 +31,7 @@ import (
|
||||
// NonBlockingGRPCServer defines Non blocking GRPC server interfaces.
|
||||
type NonBlockingGRPCServer interface {
|
||||
// Start services at the endpoint
|
||||
Start(endpoint string, srv Servers, middlewareConfig MiddlewareServerOptionConfig)
|
||||
Start(endpoint string, srv *Servers, middlewareConfig MiddlewareServerOptionConfig)
|
||||
// Waits for the service to stop
|
||||
Wait()
|
||||
// Stops the service gracefully
|
||||
@ -62,11 +62,11 @@ type nonBlockingGRPCServer struct {
|
||||
// Start start service on endpoint.
|
||||
func (s *nonBlockingGRPCServer) Start(
|
||||
endpoint string,
|
||||
srv Servers,
|
||||
srv *Servers,
|
||||
middlewareConfig MiddlewareServerOptionConfig,
|
||||
) {
|
||||
s.wg.Add(1)
|
||||
go s.serve(endpoint, srv, middlewareConfig)
|
||||
go s.serve(endpoint, *srv, middlewareConfig)
|
||||
}
|
||||
|
||||
// Wait blocks until the WaitGroup counter.
|
||||
|
Reference in New Issue
Block a user