From c7a57121b69a33fd44c590314d286a85a0bb1b74 Mon Sep 17 00:00:00 2001 From: Andre Medeiros Date: Tue, 1 Nov 2022 19:08:10 -0400 Subject: [PATCH] change prefetch limit for notifications worker --- internal/worker/notifications.go | 2 +- internal/worker/worker.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/worker/notifications.go b/internal/worker/notifications.go index ead836f..cd974f9 100644 --- a/internal/worker/notifications.go +++ b/internal/worker/notifications.go @@ -95,7 +95,7 @@ func (nw *notificationsWorker) Start() error { nw.logger.Info("starting up notifications worker", zap.Int("consumers", nw.consumers)) - prefetchLimit := int64(nw.consumers * 4) + prefetchLimit := int64(nw.consumers * 20) if err := queue.StartConsuming(prefetchLimit, pollDuration); err != nil { return err diff --git a/internal/worker/worker.go b/internal/worker/worker.go index fb01eff..b514823 100644 --- a/internal/worker/worker.go +++ b/internal/worker/worker.go @@ -11,7 +11,7 @@ import ( "go.uber.org/zap" ) -const pollDuration = 50 * time.Millisecond +const pollDuration = 100 * time.Millisecond type NewWorkerFn func(context.Context, *zap.Logger, *statsd.Client, *pgxpool.Pool, *redis.Client, rmq.Connection, int) Worker type Worker interface {