Skip to content

Commit d4b1e10

Browse files
try to fix lint
1 parent 502b4fb commit d4b1e10

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

modules/queue/workergroup.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,9 @@ 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.
155155
func (q *WorkerPoolQueue[T]) doStartNewWorker(wp *workerGroup[T]) {
156-
&wp.wg.Go(func() {
156+
wp.wg.Add(1)
157+
go func() {
158+
defer wp.wg.Done()
157159
log.Debug("Queue %q starts new worker", q.GetName())
158160
defer log.Debug("Queue %q stops idle worker", q.GetName())
159161

@@ -188,7 +190,7 @@ func (q *WorkerPoolQueue[T]) doStartNewWorker(wp *workerGroup[T]) {
188190
q.workerNumMu.Unlock()
189191
}
190192
}
191-
})
193+
}()
192194
}
193195

194196
// doFlush flushes the queue: it tries to read all items from the queue and handles them.

0 commit comments

Comments
 (0)