Increase maximum concurrency of queue messages from 4 to 16
@@ -12,6 +12,10 @@ import (
"cred-alert/metrics"
)
+const (
+ maxOutstandingMessages = 16
+)
+
type pubSubSubscriber struct {
logger lager.Logger
subscription *pubsub.Subscription
@@ -51,7 +55,7 @@ func (p *pubSubSubscriber) Run(signals <-chan os.Signal, ready chan<- struct{})
cctx, cancel := context.WithCancel(context.Background())
defer cancel()
- p.subscription.ReceiveSettings.MaxOutstandingMessages = 4
+ p.subscription.ReceiveSettings.MaxOutstandingMessages = maxOutstandingMessages
go func() {
errs <- p.subscription.Receive(cctx, func(ctx context.Context, message *pubsub.Message) {
