Skip to content

Commit

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

func (w *OrderWorker) Run() {
retryCount := 0
ctx := context.Background()
go w.fillQueue()
for i := 1; i <= w.workerCount; i++ {
errorCh := w.worker()
select {
case <-w.ctx.Done():
case <-ctx.Done():
return
case err := <-errorCh:
if err != nil && retryCount < w.retryWorkerCount {
Expand Down

0 comments on commit c7fb57b

Please sign in to comment.