Merge pull request #38802 from AarDG10/fix-queue
fix(queue): correct the conditional check in retry_sending_emails
This commit is contained in:
commit
e9d579125d
1 changed files with 3 additions and 1 deletions
|
|
@ -183,6 +183,8 @@ def get_queue():
|
||||||
|
|
||||||
|
|
||||||
def retry_sending_emails():
|
def retry_sending_emails():
|
||||||
|
from frappe.email.doctype.email_queue.email_queue import get_email_retry_limit
|
||||||
|
|
||||||
emails_in_sending = frappe.get_all(
|
emails_in_sending = frappe.get_all(
|
||||||
"Email Queue", filters={"status": "Sending"}, fields=["name", "modified"]
|
"Email Queue", filters={"status": "Sending"}, fields=["name", "modified"]
|
||||||
)
|
)
|
||||||
|
|
@ -193,7 +195,7 @@ def retry_sending_emails():
|
||||||
sent_to_atleast_one_recipient = any(
|
sent_to_atleast_one_recipient = any(
|
||||||
rec.recipient for rec in email_queue.recipients if rec.is_mail_sent()
|
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(
|
update_fields.update(
|
||||||
{
|
{
|
||||||
"status": "Partially Sent" if sent_to_atleast_one_recipient else "Not Sent",
|
"status": "Partially Sent" if sent_to_atleast_one_recipient else "Not Sent",
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue