From 55619cc12f979a55f33d646cd2548ff5d47cdd4b 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:03:17 +0300 Subject: [PATCH] fix review part6 --- internal/workers/order.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/workers/order.go b/internal/workers/order.go index 3bce276..059296b 100644 --- a/internal/workers/order.go +++ b/internal/workers/order.go @@ -29,6 +29,8 @@ func (w *OrderWorker) Run() { for i := 1; i <= w.workerCount; i++ { errorCh := w.worker() select { + case <-w.ctx.Done(): + return case err := <-errorCh: if err != nil && retryCount < w.retryWorkerCount { w.worker()