mirror of
https://github.com/ClusterCockpit/cc-metric-collector.git
synced 2024-12-26 15:29:04 +01:00
Allow more then one background send operation
This commit is contained in:
parent
78fac33a06
commit
4bee75d4b5
@ -366,7 +366,6 @@ func (s *InfluxSink) Flush() error {
|
|||||||
cclog.ComponentDebug(s.name, "Flush(): Flushing", numRecordsInBuf, "metrics")
|
cclog.ComponentDebug(s.name, "Flush(): Flushing", numRecordsInBuf, "metrics")
|
||||||
|
|
||||||
// Asynchron send of encoder metrics
|
// Asynchron send of encoder metrics
|
||||||
s.sendWaitGroup.Wait()
|
|
||||||
s.sendWaitGroup.Add(1)
|
s.sendWaitGroup.Add(1)
|
||||||
go func() {
|
go func() {
|
||||||
defer s.sendWaitGroup.Done()
|
defer s.sendWaitGroup.Done()
|
||||||
@ -404,7 +403,7 @@ func (s *InfluxSink) Close() {
|
|||||||
cclog.ComponentError(s.name, "Close():", "Flush failed:", err)
|
cclog.ComponentError(s.name, "Close():", "Flush failed:", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Wait for send operation to finish
|
// Wait for send operations to finish
|
||||||
s.sendWaitGroup.Wait()
|
s.sendWaitGroup.Wait()
|
||||||
|
|
||||||
s.client.Close()
|
s.client.Close()
|
||||||
|
Loading…
Reference in New Issue
Block a user