Move wg increment inside goroutines. Make GC calls less aggressive

This commit is contained in:
2026-01-27 17:25:29 +01:00
parent 55cb2cb6d6
commit bbde91a1f9
4 changed files with 44 additions and 48 deletions

View File

@@ -15,15 +15,14 @@ import (
)
func DataStaging(wg *sync.WaitGroup, ctx context.Context) {
// AvroPool is a pool of Avro writers.
wg.Add(1)
go func() {
if Keys.Checkpoints.FileFormat == "json" {
wg.Done() // Mark this goroutine as done
return // Exit the goroutine
}
defer wg.Done()
if Keys.Checkpoints.FileFormat == "json" {
return
}
ms := GetMemoryStore()
var avroLevel *AvroLevel
oldSelector := make([]string, 0)