mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-08 15:51:19 +00:00
fix: for deadlock issue keep status as In Progress
This commit is contained in:
@@ -286,7 +286,7 @@ def repost(doc):
|
|||||||
|
|
||||||
status = "Failed"
|
status = "Failed"
|
||||||
# If failed because of timeout, set status to In Progress
|
# 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"
|
status = "In Progress"
|
||||||
|
|
||||||
if traceback:
|
if traceback:
|
||||||
@@ -301,13 +301,14 @@ def repost(doc):
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
outgoing_email_account = frappe.get_cached_value(
|
if status == "Failed":
|
||||||
"Email Account", {"default_outgoing": 1, "enable_outgoing": 1}, "name"
|
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):
|
if outgoing_email_account and not isinstance(e, RecoverableErrors):
|
||||||
notify_error_to_stock_managers(doc, message)
|
notify_error_to_stock_managers(doc, message)
|
||||||
doc.set_status("Failed")
|
doc.set_status("Failed")
|
||||||
finally:
|
finally:
|
||||||
if not frappe.flags.in_test:
|
if not frappe.flags.in_test:
|
||||||
frappe.db.commit()
|
frappe.db.commit()
|
||||||
|
|||||||
Reference in New Issue
Block a user