diff --git a/pkg/disk/disk.go b/pkg/disk/disk.go index aae4a0cca..95c218e1d 100644 --- a/pkg/disk/disk.go +++ b/pkg/disk/disk.go @@ -85,11 +85,8 @@ func NewServer(ctx context.Context, spdkEnabled bool, spdkServiceAddress string) } func (s *Server) startMonitoring() { - for { - <-s.ctx.Done() - logrus.Infof("%s: stopped monitoring due to the context done", types.DiskGrpcService) - break - } + <-s.ctx.Done() + logrus.Infof("%s: stopped monitoring due to the context done", types.DiskGrpcService) } func (s *Server) VersionGet(ctx context.Context, req *emptypb.Empty) (*rpc.DiskVersionResponse, error) { diff --git a/pkg/instance/instance.go b/pkg/instance/instance.go index 069a4297f..a22d65647 100644 --- a/pkg/instance/instance.go +++ b/pkg/instance/instance.go @@ -87,11 +87,8 @@ func NewServer(ctx context.Context, logsDir, processManagerServiceAddress, spdkS } func (s *Server) startMonitoring() { - for { - <-s.ctx.Done() - logrus.Infof("%s: stopped monitoring due to the context done", types.InstanceGrpcService) - break - } + <-s.ctx.Done() + logrus.Infof("%s: stopped monitoring due to the context done", types.InstanceGrpcService) } func (s *Server) VersionGet(ctx context.Context, req *emptypb.Empty) (*rpc.VersionResponse, error) { diff --git a/pkg/proxy/proxy.go b/pkg/proxy/proxy.go index 98989b8d8..4d3089fa3 100644 --- a/pkg/proxy/proxy.go +++ b/pkg/proxy/proxy.go @@ -79,11 +79,8 @@ func NewProxy(ctx context.Context, logsDir, diskServiceAddress, spdkServiceAddre } func (p *Proxy) startMonitoring() { - for { - <-p.ctx.Done() - logrus.Infof("%s: stopped monitoring due to the context done", types.ProxyGRPCService) - break - } + <-p.ctx.Done() + logrus.Infof("%s: stopped monitoring due to the context done", types.ProxyGRPCService) } func (p *Proxy) ServerVersionGet(ctx context.Context, req *rpc.ProxyEngineRequest) (resp *rpc.EngineVersionProxyResponse, err error) {