Merge pull request #46779 from frappe/mergify/bp/version-15-hotfix/pr-46775

fix: for deadlock issue keep status as In Progress (backport #46775)
This commit is contained in:
rohitwaghchaure
2025-03-29 12:16:55 +05:30
committed by GitHub

View File

@@ -291,7 +291,7 @@ def repost(doc):
status = "Failed"
# If failed because of timeout, set status to In Progress
if traceback and "timeout" in traceback.lower():
if traceback and ("timeout" in traceback.lower() or "Deadlock found" in traceback):
status = "In Progress"
if traceback:
@@ -306,13 +306,14 @@ def repost(doc):
},
)
outgoing_email_account = frappe.get_cached_value(
"Email Account", {"default_outgoing": 1, "enable_outgoing": 1}, "name"
)
if status == "Failed":
outgoing_email_account = frappe.get_cached_value(
"Email Account", {"default_outgoing": 1, "enable_outgoing": 1}, "name"
)
if outgoing_email_account and not isinstance(e, RecoverableErrors):
notify_error_to_stock_managers(doc, message)
doc.set_status("Failed")
if outgoing_email_account and not isinstance(e, RecoverableErrors):
notify_error_to_stock_managers(doc, message)
doc.set_status("Failed")
finally:
if not frappe.flags.in_test:
frappe.db.commit()