mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-02 19:59:12 +00:00
fix: dont fail repost for recoverable errors (#30979)
recoverable erros: 1. timeout 2. lock/deadlocks
This commit is contained in:
21
erpnext/patches/v13_0/requeue_recoverable_reposts.py
Normal file
21
erpnext/patches/v13_0/requeue_recoverable_reposts.py
Normal file
@@ -0,0 +1,21 @@
|
||||
import frappe
|
||||
|
||||
|
||||
def execute():
|
||||
recoverable = ("QueryDeadlockError", "QueryTimeoutError", "JobTimeoutException")
|
||||
|
||||
failed_reposts = frappe.get_all(
|
||||
"Repost Item Valuation",
|
||||
fields=["name", "error_log"],
|
||||
filters={
|
||||
"status": "Failed",
|
||||
"docstatus": 1,
|
||||
"modified": (">", "2022-04-20"),
|
||||
"error_log": ("is", "set"),
|
||||
},
|
||||
)
|
||||
for riv in failed_reposts:
|
||||
for exc in recoverable:
|
||||
if exc in riv.error_log:
|
||||
frappe.db.set_value("Repost Item Valuation", riv.name, "status", "Queued")
|
||||
break
|
||||
Reference in New Issue
Block a user