[FIX] mail: process first 100 mail failures only
Processing failed mails is quite consuming operation that leads to browser slowness or even crash. It's especially painful, because user doesn't see the reason for it. Bypass the problem by processing first 100 notifications only. --- opw-2810681 opw-2754243 task-2806549 closes odoo/odoo#90246 X-original-commit: ec2d3550f32ae1e0585630b5b38befb73ddf2b26 Signed-off-by: Sébastien Theys (seb) <seb@odoo.com> Signed-off-by: Ivan Elizaryev (iel) <iel@odoo.com>
This commit is contained in:
@@ -125,7 +125,7 @@ class Partner(models.Model):
|
||||
return partners_format
|
||||
|
||||
def _message_fetch_failed(self):
|
||||
"""Returns all messages, sent by the current partner, that have errors, in
|
||||
"""Returns first 100 messages, sent by the current partner, that have errors, in
|
||||
the format expected by the web client."""
|
||||
self.ensure_one()
|
||||
notifications = self.env['mail.notification'].search([
|
||||
@@ -134,7 +134,7 @@ class Partner(models.Model):
|
||||
('mail_message_id.message_type', '!=', 'user_notification'),
|
||||
('mail_message_id.model', '!=', False),
|
||||
('mail_message_id.res_id', '!=', 0),
|
||||
])
|
||||
], limit=100)
|
||||
return notifications.mail_message_id._message_notification_format()
|
||||
|
||||
def _get_channels_as_member(self):
|
||||
|
||||
Reference in New Issue
Block a user