app/vmagent/remotewrite: fix parallel data sending to remote storage systems at e0d2ba5608

This commit is contained in:
Aliaksandr Valialkin 2021-11-04 16:58:28 +02:00
parent a69264e885
commit 4839d07f34
No known key found for this signature in database
GPG key ID: A72BEC6CD3D0DED1

View file

@ -323,12 +323,12 @@ func pushBlockToRemoteStorages(rwctxs []*remoteWriteCtx, tssBlock []prompbmarsha
var wg sync.WaitGroup
for _, rwctx := range rwctxs {
wg.Add(1)
go func() {
go func(rwctx *remoteWriteCtx) {
defer wg.Done()
rwctx.Push(tssBlock)
}()
wg.Wait()
}(rwctx)
}
wg.Wait()
}
// sortLabelsIfNeeded sorts labels if -sortLabels command-line flag is set.