Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Пешков Дмитрий committed Sep 21, 2024
1 parent 86fc990 commit 516a363
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion internal/workers/order.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,20 @@ func NewOrderWorker(ctx context.Context, orderService *services.OrderService, or
}

func (w *OrderWorker) Run() {
retryCount := 0
go w.fillQueue()
for i := 1; i <= w.workerCount; i++ {
w.worker()
errorCh := w.worker()

go func() {
for {
err := <-errorCh
if err != nil && retryCount < 10 {
w.worker()
retryCount++
}
}
}()
}
}

Expand Down

0 comments on commit 516a363

Please sign in to comment.