remove incorrect use of WaitGroup (#16596)

This commit is contained in:
jiuker authored and GitHub committed 2023-02-12 20:59:45 -08:00
1 parent 689179bf18
commit a15b6f21b8
2 files changed
-10

No files matched your search

-3
View File
@@ -1029,7 +1029,6 @@ type BatchJobPool struct {
mu sync.Mutex
jobCh chan *BatchJobRequest
workerKillCh chan struct{}
workerWg sync.WaitGroup
workerSize int
}
@@ -1074,7 +1073,6 @@ func (j *BatchJobPool) AddWorker() {
if j == nil {
return
}
defer j.workerWg.Done()
for {
select {
case <-j.ctx.Done():
@@ -1110,7 +1108,6 @@ func (j *BatchJobPool) ResizeWorkers(n int) {
for j.workerSize < n {
j.workerSize++
j.workerWg.Add(1)
go j.AddWorker()
}
for j.workerSize > n {