Handle shutdown sequentially

This commit is contained in:
Holger Obermaier
2022-01-27 17:43:00 +01:00
parent e1d0aacd1e
commit b9236dcc31
7 changed files with 37 additions and 42 deletions

View File

@@ -151,11 +151,8 @@ func (cm *collectorManager) AddOutput(output chan lp.CCMetric) {
// Close finishes / stops the metric collector manager
func (cm *collectorManager) Close() {
select {
case cm.done <- true:
default:
}
cclog.ComponentDebug("CollectorManager", "CLOSE")
cm.done <- true
}
// New creates a new initialized metric collector manager

View File

@@ -10,6 +10,7 @@ import (
"strconv"
"strings"
"time"
lp "github.com/ClusterCockpit/cc-metric-collector/internal/ccMetric"
"golang.org/x/sys/unix"
)