diff --git a/pkg/disk/disk.go b/pkg/disk/disk.go index d693aab0d..78f8103c4 100644 --- a/pkg/disk/disk.go +++ b/pkg/disk/disk.go @@ -85,17 +85,10 @@ func NewServer(ctx context.Context, spdkEnabled bool, spdkServiceAddress string) } func (s *Server) startMonitoring() { - done := false for { - select { - case <-s.ctx.Done(): - logrus.Infof("%s: stopped monitoring replicas due to the context done", types.DiskGrpcService) - done = true - default: - } - if done { - break - } + <-s.ctx.Done() + logrus.Infof("%s: stopped monitoring due to the context done", types.DiskGrpcService) + break } } diff --git a/pkg/instance/instance.go b/pkg/instance/instance.go index 011eb3949..520fe3ea0 100644 --- a/pkg/instance/instance.go +++ b/pkg/instance/instance.go @@ -83,17 +83,10 @@ func NewServer(ctx context.Context, logsDir, processManagerServiceAddress, spdkS } func (s *Server) startMonitoring() { - done := false for { - select { - case <-s.ctx.Done(): - logrus.Infof("%s: stopped monitoring replicas due to the context done", types.InstanceGrpcService) - done = true - default: - } - if done { - break - } + <-s.ctx.Done() + logrus.Infof("%s: stopped monitoring due to the context done", types.InstanceGrpcService) + break } } diff --git a/pkg/proxy/proxy.go b/pkg/proxy/proxy.go index 314b9f6de..4e2ef898b 100644 --- a/pkg/proxy/proxy.go +++ b/pkg/proxy/proxy.go @@ -79,17 +79,10 @@ func NewProxy(ctx context.Context, logsDir, diskServiceAddress, spdkServiceAddre } func (p *Proxy) startMonitoring() { - done := false for { - select { - case <-p.ctx.Done(): - logrus.Infof("%s: stopped monitoring replicas due to the context done", types.ProxyGRPCService) - done = true - default: - } - if done { - break - } + <-p.ctx.Done() + logrus.Infof("%s: stopped monitoring due to the context done", types.ProxyGRPCService) + break } }