Merge pull request #38802 from AarDG10/fix-queue

fix(queue): correct the conditional check in retry_sending_emails
This commit is contained in:
Aarol D'Souza 2026-04-22 17:34:14 +05:30 committed by GitHub
commit e9d579125d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -183,6 +183,8 @@ def get_queue():
def retry_sending_emails():
from frappe.email.doctype.email_queue.email_queue import get_email_retry_limit
emails_in_sending = frappe.get_all(
"Email Queue", filters={"status": "Sending"}, fields=["name", "modified"]
)
@ -193,7 +195,7 @@ def retry_sending_emails():
sent_to_atleast_one_recipient = any(
rec.recipient for rec in email_queue.recipients if rec.is_mail_sent()
)
if email_queue.retry < cint(frappe.db.get_system_setting("email_retry_limit")) or 3:
if email_queue.retry < get_email_retry_limit():
update_fields.update(
{
"status": "Partially Sent" if sent_to_atleast_one_recipient else "Not Sent",