fix: erase logs in case of complete failure
This commit is contained in:
parent
2710c28870
commit
9f7c385b11
1 changed files with 5 additions and 1 deletions
|
|
@ -102,9 +102,13 @@ class Importer:
|
|||
log_index = 0
|
||||
|
||||
# Do not remove rows in case of retry after an error or pending data import
|
||||
if self.data_import.status == "Partial Success" and len(import_log) >= self.data_import.payload_count:
|
||||
if (
|
||||
self.data_import.status in ("Partial Success", "Error")
|
||||
and len(import_log) >= self.data_import.payload_count
|
||||
):
|
||||
# remove previous failures from import log only in case of retry after partial success
|
||||
import_log = [log for log in import_log if log.get("success")]
|
||||
frappe.db.delete("Data Import Log", {"success": 0, "data_import": self.data_import.name})
|
||||
|
||||
# get successfully imported rows
|
||||
imported_rows = []
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue