cleanup: use plain channel send or receive instead of single-case select

Signed-off-by: wangyx1992 <wang.yixiang@zte.com.cn>
This commit is contained in:
wangyx1992 2021-04-23 11:17:12 +08:00
parent 1ceddc790d
commit 31d449bf57

View File

@ -138,8 +138,7 @@ func (bus *DBusCon) MonitorShutdown() (<-chan bool, error) {
go func() {
for {
select {
case event := <-busChan:
event := <-busChan
if event == nil || len(event.Body) == 0 {
klog.ErrorS(nil, "Failed obtaining shutdown event, PrepareForShutdown event was empty")
continue
@ -150,7 +149,7 @@ func (bus *DBusCon) MonitorShutdown() (<-chan bool, error) {
continue
}
shutdownChan <- shutdownActive
}
}
}()