From c7fb57b4b41b397553eedc8f7f4631c502e35696 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D0=B5=D1=88=D0=BA=D0=BE=D0=B2=20=D0=94=D0=BC=D0=B8?= =?UTF-8?q?=D1=82=D1=80=D0=B8=D0=B9?= Date: Fri, 20 Sep 2024 21:06:35 +0300 Subject: [PATCH] fix review part6 --- internal/workers/order.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/workers/order.go b/internal/workers/order.go index 059296b..8244742 100644 --- a/internal/workers/order.go +++ b/internal/workers/order.go @@ -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 {