mirror of
https://github.com/ClusterCockpit/cc-metric-collector.git
synced 2025-07-20 11:51:40 +02:00
Handle shutdown sequentially
This commit is contained in:
@@ -225,18 +225,12 @@ func (r *metricRouter) AddOutput(output chan lp.CCMetric) {
|
||||
|
||||
// Close finishes / stops the metric router
|
||||
func (r *metricRouter) Close() {
|
||||
select {
|
||||
case r.done <- true:
|
||||
default:
|
||||
}
|
||||
cclog.ComponentDebug("MetricRouter", "CLOSE")
|
||||
r.done <- true
|
||||
if r.config.IntervalStamp {
|
||||
cclog.ComponentDebug("MetricRouter", "TIMER CLOSE")
|
||||
select {
|
||||
case r.timerdone <- true:
|
||||
default:
|
||||
}
|
||||
r.timerdone <- true
|
||||
}
|
||||
cclog.ComponentDebug("MetricRouter", "CLOSE")
|
||||
}
|
||||
|
||||
// New creates a new initialized metric router
|
||||
|
Reference in New Issue
Block a user