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 {