mirror of
https://github.com/ClusterCockpit/cc-metric-collector.git
synced 2026-02-13 22:51:45 +01:00
Goroutine creation can be simplified using WaitGroup.Go (modernize)
This commit is contained in:
@@ -123,9 +123,7 @@ func (cm *collectorManager) Start() {
|
||||
tick := make(chan time.Time)
|
||||
cm.ticker.AddChannel(tick)
|
||||
|
||||
cm.wg.Add(1)
|
||||
go func() {
|
||||
defer cm.wg.Done()
|
||||
cm.wg.Go(func() {
|
||||
// Collector manager is done
|
||||
done := func() {
|
||||
// close all metric collectors
|
||||
@@ -180,7 +178,7 @@ func (cm *collectorManager) Start() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}()
|
||||
})
|
||||
|
||||
// Collector manager is started
|
||||
cclog.ComponentDebug("CollectorManager", "STARTED")
|
||||
|
||||
Reference in New Issue
Block a user