diff --git a/app/lib/message_dequeuer/initial_processor.rb b/app/lib/message_dequeuer/initial_processor.rb index 37ad9aa4..a49495b6 100644 --- a/app/lib/message_dequeuer/initial_processor.rb +++ b/app/lib/message_dequeuer/initial_processor.rb @@ -57,7 +57,7 @@ def check_message_is_ready def find_other_messages_for_batch return unless Postal::Config.postal.batch_queued_messages? - @other_messages = @queued_message.batchable_messages(100) + @other_messages = @queued_message.batchable_messages(Postal::Config.postal.batch_queued_messages_limit) log "found #{@other_messages.size} associated messages to process at the same time", batch_key: @queued_message.batch_key rescue StandardError @queued_message.unlock diff --git a/doc/config/yaml.yml b/doc/config/yaml.yml index 1035ec99..cbf83d96 100644 --- a/doc/config/yaml.yml +++ b/doc/config/yaml.yml @@ -33,6 +33,8 @@ postal: queued_message_lock_stale_days: 1 # When enabled queued messages will be de-queued in batches based on their destination batch_queued_messages: true + # When de-queuing in batches, use this limit for the batch size + batch_queued_messages_limit: 100 web_server: # The default port the web server should listen on unless overriden by the PORT environment variable diff --git a/lib/postal/config_schema.rb b/lib/postal/config_schema.rb index af3c7330..8553aafd 100644 --- a/lib/postal/config_schema.rb +++ b/lib/postal/config_schema.rb @@ -101,6 +101,11 @@ module Postal description "When enabled queued messages will be de-queued in batches based on their destination" default true end + + integer :batch_queued_messages_limit do + description "When de-queuing in batches, use this limit for the batch size" + default 100 + end end group :web_server do