Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Init #1

Open
wants to merge 32 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
fix
  • Loading branch information
Пешков Дмитрий committed Sep 21, 2024
commit 516a3634bdb6466af88057d559514eee89db8c34
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 {
spqrcor marked this conversation as resolved.
Show resolved Hide resolved
err := <-errorCh
if err != nil && retryCount < 10 {
w.worker()
retryCount++
}
}
}()
}
}

Expand Down
Loading