Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: keep status as In Progress for RIV for Timeout Error (backport #42274) #42504

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -237,17 +237,30 @@ def repost(doc):
doc.log_error("Unable to repost item valuation")

message = frappe.message_log.pop() if frappe.message_log else ""

status = "Failed"
# If failed because of timeout, set status to In Progress
if traceback and "timeout" in traceback.lower():
status = "In Progress"

if traceback:
message += "<br>" + "Traceback: <br>" + traceback
frappe.db.set_value(doc.doctype, doc.name, "error_log", message)

frappe.db.set_value(
doc.doctype,
doc.name,
{
"error_log": message,
"status": status,
},
)

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")
finally:
if not frappe.flags.in_test:
frappe.db.commit()
Expand Down
Loading