Skip to content

Commit

Permalink
fix: worker tests deadlock
Browse files Browse the repository at this point in the history
  • Loading branch information
turtleDev committed Jun 8, 2024
1 parent 8a3827f commit 6232247
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions worker/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func CreateWorkerPool(size int, eventsChannel <-chan collection.CollectRequest,
}
}

func (w *Pool) newWorker(name string) {
func (w *Pool) worker(name string) {

logger.Info("Running worker: " + name)
for request := range w.EventsChannel {
Expand Down Expand Up @@ -98,7 +98,7 @@ func (w *Pool) newWorker(name string) {
func (w *Pool) StartWorkers() {
w.wg.Add(w.Size)
for i := 0; i < w.Size; i++ {
w.newWorker(fmt.Sprintf("worker-%d", i))
go w.worker(fmt.Sprintf("worker-%d", i))
}
}

Expand Down

0 comments on commit 6232247

Please sign in to comment.