refactor: update traceback on retry
(cherry picked from commit a52a1b49af1c7b72ba85563057f60bb7cf54e81c)
This commit is contained in:
parent
df5fcbee71
commit
f28d718732
@ -59,14 +59,16 @@ def retry_failed_transactions(failed_docs: list | None):
|
||||
task(log.transaction_name, log.from_doctype, log.to_doctype)
|
||||
except Exception as e:
|
||||
frappe.db.rollback(save_point="before_creation_state")
|
||||
update_log(log.name, "Failed", 1)
|
||||
update_log(log.name, "Failed", 1, str(frappe.get_traceback()))
|
||||
else:
|
||||
update_log(log.name, "Success", 1)
|
||||
|
||||
|
||||
def update_log(log_name, status, retried):
|
||||
def update_log(log_name, status, retried, err=None):
|
||||
frappe.db.set_value("Bulk Transaction Log Detail", log_name, "transaction_status", status)
|
||||
frappe.db.set_value("Bulk Transaction Log Detail", log_name, "retried", retried)
|
||||
if err:
|
||||
frappe.db.set_value("Bulk Transaction Log Detail", log_name, "error_description", err)
|
||||
|
||||
|
||||
def job(deserialized_data, from_doctype, to_doctype):
|
||||
|
Loading…
x
Reference in New Issue
Block a user