Skip to content

Commit

Permalink
bulk_indexer: Follow convention and add to waitgroup before creating …
Browse files Browse the repository at this point in the history
…routines (#891)
  • Loading branch information
HaraldNordgren authored Aug 2, 2024
1 parent 20b86e8 commit dd25a11
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion esutil/bulk_indexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ func (bi *bulkIndexer) init() {
bi.queue = make(chan BulkIndexerItem, bi.config.NumWorkers)

for i := 1; i <= bi.config.NumWorkers; i++ {
bi.wg.Add(1)
w := worker{
id: i,
ch: bi.queue,
Expand All @@ -380,7 +381,6 @@ func (bi *bulkIndexer) init() {
w.run()
bi.workers = append(bi.workers, &w)
}
bi.wg.Add(bi.config.NumWorkers)
}

// worker represents an indexer worker.
Expand Down

0 comments on commit dd25a11

Please sign in to comment.