Skip to content

Commit dd25a11

Browse files
bulk_indexer: Follow convention and add to waitgroup before creating routines (#891)
1 parent 20b86e8 commit dd25a11

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

esutil/bulk_indexer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,7 @@ func (bi *bulkIndexer) init() {
370370
bi.queue = make(chan BulkIndexerItem, bi.config.NumWorkers)
371371

372372
for i := 1; i <= bi.config.NumWorkers; i++ {
373+
bi.wg.Add(1)
373374
w := worker{
374375
id: i,
375376
ch: bi.queue,
@@ -380,7 +381,6 @@ func (bi *bulkIndexer) init() {
380381
w.run()
381382
bi.workers = append(bi.workers, &w)
382383
}
383-
bi.wg.Add(bi.config.NumWorkers)
384384
}
385385

386386
// worker represents an indexer worker.

0 commit comments

Comments
 (0)