From 12ae4579895ed679cf7ff64f49904cc98d4d4d15 Mon Sep 17 00:00:00 2001 From: Pablo Manuel Castelo Vigo Date: Mon, 30 Sep 2024 20:56:41 +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 3b8507c0039fb..0714d259e621f 100644 --- a/addons/mail/models/mail_mail.py +++ b/addons/mail/models/mail_mail.py @@ -236,8 +236,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: