From 4bee75d4b5086ca90fc437f097492613f862e1a0 Mon Sep 17 00:00:00 2001 From: Holger Obermaier <40787752+ho-ob@users.noreply.github.com> Date: Fri, 13 Oct 2023 15:15:10 +0200 Subject: [PATCH] Allow more then one background send operation --- sinks/influxSink.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sinks/influxSink.go b/sinks/influxSink.go index 582a5d1..a9d46a5 100644 --- a/sinks/influxSink.go +++ b/sinks/influxSink.go @@ -366,7 +366,6 @@ func (s *InfluxSink) Flush() error { cclog.ComponentDebug(s.name, "Flush(): Flushing", numRecordsInBuf, "metrics") // Asynchron send of encoder metrics - s.sendWaitGroup.Wait() s.sendWaitGroup.Add(1) go func() { defer s.sendWaitGroup.Done() @@ -404,7 +403,7 @@ func (s *InfluxSink) Close() { cclog.ComponentError(s.name, "Close():", "Flush failed:", err) } - // Wait for send operation to finish + // Wait for send operations to finish s.sendWaitGroup.Wait() s.client.Close()