feat: enhance concurrency management by adding WaitGroup support in extractors and loaders

This commit is contained in:
2026-04-09 00:22:30 -05:00
parent dc632361e5
commit 51480015ba
8 changed files with 82 additions and 68 deletions

View File

@@ -3,6 +3,7 @@ package main
import (
"context"
"errors"
"sync"
"time"
log "github.com/sirupsen/logrus"
@@ -21,6 +22,7 @@ func transformRowsMssql(
chChunksIn <-chan Chunk,
chChunksOut chan<- Chunk,
chJobErrorsOut chan<- JobError,
wgActiveChunks *sync.WaitGroup,
) {
transformationPlan := computeTransformationPlan(columns)
@@ -41,6 +43,7 @@ func transformRowsMssql(
if len(transformationPlan) == 0 {
select {
case chChunksOut <- chunk:
wgActiveChunks.Add(1)
continue
case <-ctx.Done():
return
@@ -69,6 +72,8 @@ func transformRowsMssql(
case <-ctx.Done():
return
}
wgActiveChunks.Add(1)
}
}
}