Skip to content

Commit

Permalink
Merge pull request #107 from timescale/vperez/fix-race-condition-on-w…
Browse files Browse the repository at this point in the history
…orker-failure

Fix race condition on worker failure
  • Loading branch information
MetalBlueberry authored Jan 13, 2025
2 parents 5885d47 + d7eb615 commit 27507a2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/csvcopy/csvcopy.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,9 @@ func (c *Copier) Copy(ctx context.Context, reader io.Reader) (Result, error) {
}

start := time.Now()
workerWg.Add(1)
go func() {
defer workerWg.Done()
if err := batch.Scan(ctx, reader, batchChan, opts); err != nil {
errCh <- fmt.Errorf("failed reading input: %w", err)
cancel()
Expand Down

0 comments on commit 27507a2

Please sign in to comment.