summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/basic/basic_controller.js
diff options
context:
space:
mode:
authorOlivier Dony <odo@openerp.com>2017-03-07 15:21:00 +0100
committerOlivier Dony <odo@openerp.com>2017-03-07 16:12:31 +0100
commit00bd7274c406fd8f69aebafcdd41dbc6b5885c96 (patch)
treee84875ed116629d155c6a0b9a79c53b0df1f153a /addons/web/static/src/js/views/basic/basic_controller.js
parenta7ff8364ea04c34dedfd8d028c78b941461ec664 (diff)
[FIX] mail: batch and speed up email queue processing
Work around performance issue when sending large mass-mailing: 1. Processing a large email queue would crash with MemoryError. -> The queue agent will now browsing the emails 1 by 1 during delivery to avoid filling the memory. -> The agent will not select more than 10k emails per delivery. The delivery rate can be increased by waking it more often. 2. Reopening a connection to the SMTP server every time is slow. -> ir.mail_server.send_email() now accepts an extra `smtp_session` optional parameter. When passed, that session will be used and will not be disconnected after the delivery. The queue processing agent prepares batches of emails to be sent to the same outgoing mail server, and uses a persistent smtp_session to avoid the multiple reconnection. To account for MTA that would refuse to process a large number of emails in the same session (that should be rare), a system parameter can be used to set the batch size (default: 1000). 3. As a bonus, the ir.mail_server.connect() method is now responsible for resolving the actual mail server parameters, rather than having half of the logic in the send_email() method. Warning: this commit drops support for "maildir:/" format in outgoing mail servers hostnames. This feature is deprecated, unused, untested, and was meant for debugging only.
Diffstat (limited to 'addons/web/static/src/js/views/basic/basic_controller.js')
0 files changed, 0 insertions, 0 deletions