diff --git a/common/utils/workerpool/workerpool.go b/common/utils/workerpool/workerpool.go index ee39647e7b..a779c4f690 100644 --- a/common/utils/workerpool/workerpool.go +++ b/common/utils/workerpool/workerpool.go @@ -15,14 +15,13 @@ type WorkerPool struct { func NewWorkerPool(maxWorker int) *WorkerPool { return &WorkerPool{ maxWorker: maxWorker, - taskQueueChan: nil, + taskQueueChan: make(chan func()), wg: sync.WaitGroup{}, } } // Run runs WorkerPool func (vwp *WorkerPool) Run() { - vwp.taskQueueChan = make(chan func()) for i := 0; i < vwp.maxWorker; i++ { go func() { for task := range vwp.taskQueueChan {