File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -153,9 +153,7 @@ func resetIdleTicker(t *time.Ticker, dur time.Duration) {
153153
154154// doStartNewWorker starts a new worker for the queue, the worker reads from worker's channel and handles the items.
155155func (q * WorkerPoolQueue [T ]) doStartNewWorker (wp * workerGroup [T ]) {
156- wp .wg .Add (1 )
157- go func () {
158- defer wp .wg .Done ()
156+ wp .wg .Go (func () {
159157 log .Debug ("Queue %q starts new worker" , q .GetName ())
160158 defer log .Debug ("Queue %q stops idle worker" , q .GetName ())
161159
@@ -190,7 +188,7 @@ func (q *WorkerPoolQueue[T]) doStartNewWorker(wp *workerGroup[T]) {
190188 q .workerNumMu .Unlock ()
191189 }
192190 }
193- }( )
191+ })
194192}
195193
196194// doFlush flushes the queue: it tries to read all items from the queue and handles them.
You can’t perform that action at this time.
0 commit comments