mirror of
https://github.com/ClusterCockpit/cc-metric-collector.git
synced 2024-12-25 15:09:05 +01:00
Cleanup
This commit is contained in:
parent
69b31e87e7
commit
2031f35d9b
@ -263,7 +263,7 @@ func (r *metricRouter) Start() {
|
||||
}
|
||||
}
|
||||
|
||||
// Foward message received from receivers channel
|
||||
// Forward message received from receivers channel
|
||||
recv_forward := func(p lp.CCMetric) {
|
||||
// receive from receive manager
|
||||
if r.config.IntervalStamp {
|
||||
@ -274,7 +274,7 @@ func (r *metricRouter) Start() {
|
||||
}
|
||||
}
|
||||
|
||||
// Foward message received from cache channel
|
||||
// Forward message received from cache channel
|
||||
cache_forward := func(p lp.CCMetric) {
|
||||
// receive from metric collector
|
||||
if !r.dropMetric(p) {
|
||||
@ -342,13 +342,18 @@ func (r *metricRouter) Close() {
|
||||
r.done <- true
|
||||
// wait for close of channel r.done
|
||||
<-r.done
|
||||
|
||||
// stop timer
|
||||
if r.config.IntervalStamp {
|
||||
cclog.ComponentDebug("MetricRouter", "TIMER CLOSE")
|
||||
r.timerdone <- true
|
||||
// wait for close of channel r.timerdone
|
||||
<-r.timerdone
|
||||
}
|
||||
|
||||
// stop metric cache
|
||||
if r.config.NumCacheIntervals > 0 {
|
||||
cclog.ComponentDebug("MetricRouter", "CACHE CLOSE")
|
||||
r.cache.Close()
|
||||
r.cachewg.Wait()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user