mirror of
https://github.com/ClusterCockpit/cc-metric-collector.git
synced 2024-12-25 15:09:05 +01:00
Move toTheSinks out of for loop
This commit is contained in:
parent
416a94aceb
commit
a3ad9d0cb0
@ -100,18 +100,17 @@ func (sm *sinkManager) Start() {
|
|||||||
cclog.ComponentDebug("SinkManager", "DONE")
|
cclog.ComponentDebug("SinkManager", "DONE")
|
||||||
}
|
}
|
||||||
|
|
||||||
for {
|
toTheSinks := func(p lp.CCMetric) {
|
||||||
|
// Send received metric to all outputs
|
||||||
toTheSinks := func(p lp.CCMetric) {
|
cclog.ComponentDebug("SinkManager", "WRITE", p)
|
||||||
// Send received metric to all outputs
|
for _, s := range sm.sinks {
|
||||||
cclog.ComponentDebug("SinkManager", "WRITE", p)
|
if err := s.Write(p); err != nil {
|
||||||
for _, s := range sm.sinks {
|
cclog.ComponentError("SinkManager", "WRITE", s.Name(), "write failed:", err.Error())
|
||||||
if err := s.Write(p); err != nil {
|
|
||||||
cclog.ComponentError("SinkManager", "WRITE", s.Name(), "write failed:", err.Error())
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for {
|
||||||
select {
|
select {
|
||||||
case <-sm.done:
|
case <-sm.done:
|
||||||
done()
|
done()
|
||||||
|
Loading…
Reference in New Issue
Block a user