mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-06 13:49:13 +00:00
perf: reduce failed_error_log size
(cherry picked from commit 0805307514)
This commit is contained in:
committed by
mergify-bot
parent
0a2bbfaf24
commit
7ee6e83605
@@ -575,11 +575,14 @@ class TallyMigration(Document):
|
|||||||
if isinstance(data, frappe.model.document.Document):
|
if isinstance(data, frappe.model.document.Document):
|
||||||
if sys.exc_info()[1].__class__ != frappe.DuplicateEntryError:
|
if sys.exc_info()[1].__class__ != frappe.DuplicateEntryError:
|
||||||
failed_import_log = json.loads(self.failed_import_log)
|
failed_import_log = json.loads(self.failed_import_log)
|
||||||
|
doc = data.as_dict()
|
||||||
|
doc_fields = { x.fieldname for x in frappe.get_doc("DocType", doc.doctype).fields }
|
||||||
|
stripped_doc = { k: v for k, v in doc.items() if k in doc_fields }
|
||||||
failed_import_log.append({
|
failed_import_log.append({
|
||||||
"doc": data.as_dict(),
|
"doc": stripped_doc,
|
||||||
"exc": traceback.format_exc()
|
"exc": traceback.format_exc()
|
||||||
})
|
})
|
||||||
self.failed_import_log = json.dumps(failed_import_log)
|
self.failed_import_log = json.dumps(failed_import_log, separators=(',', ':'))
|
||||||
self.save()
|
self.save()
|
||||||
else:
|
else:
|
||||||
data = data or self.status
|
data = data or self.status
|
||||||
|
|||||||
Reference in New Issue
Block a user