feat: enhance concurrency management by adding WaitGroup support in extractors and loaders
This commit is contained in:
@@ -3,6 +3,7 @@ package main
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"sync"
|
||||
)
|
||||
|
||||
type LoaderError struct {
|
||||
@@ -19,6 +20,7 @@ func loaderErrorHandler(
|
||||
chErrorsIn <-chan LoaderError,
|
||||
chChunksOut chan<- Chunk,
|
||||
chJobErrorsOut chan<- JobError,
|
||||
wgActiveChunks *sync.WaitGroup,
|
||||
) {
|
||||
for {
|
||||
if ctx.Err() != nil {
|
||||
@@ -46,6 +48,8 @@ func loaderErrorHandler(
|
||||
case <-ctx.Done():
|
||||
return
|
||||
}
|
||||
|
||||
wgActiveChunks.Done()
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user