remove incorrect use of WaitGroup (#16596)

This commit is contained in:
jiuker
2023-02-13 12:59:45 +08:00
committed by GitHub
parent 689179bf18
commit a15b6f21b8
2 changed files with 0 additions and 10 deletions

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 {