From 55bee68fe7747f39b3af8ec21379f75825b127ca Mon Sep 17 00:00:00 2001 From: Pablo Manuel Castelo Vigo Date: Wed, 18 Sep 2024 13:58:48 +0200 Subject: [PATCH] [15.0] [IMP] Make mail batch size configurable --- addons/mail/models/mail_mail.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/mail/models/mail_mail.py b/addons/mail/models/mail_mail.py index fd5a753dc5dab..88f8c3a18c582 100644 --- a/addons/mail/models/mail_mail.py +++ b/addons/mail/models/mail_mail.py @@ -178,8 +178,8 @@ def process_email_queue(self, ids=None): ] if 'filters' in self._context: filters.extend(self._context['filters']) - # TODO: make limit configurable - filtered_ids = self.search(filters, limit=10000).ids + batch_size = int(self.env['ir.config_parameter'].sudo().get_param('mail.mail.queue.batch.size', 10000)) + filtered_ids = self.search(filters, limit=batch_size).ids if not ids: ids = filtered_ids else: