瀏覽代碼

Only addItemsHandled if the importRecord succeeded

Peter Richter 4 年之前
父節點
當前提交
10dac2bbbf
共有 1 個文件被更改,包括 8 次插入2 次删除
  1. 8 2
      tripal_chado/includes/TripalImporter/TaxonomyImporter.inc

+ 8 - 2
tripal_chado/includes/TripalImporter/TaxonomyImporter.inc

@@ -275,8 +275,12 @@ class TaxonomyImporter extends TripalImporter {
       foreach ($tax_ids as $tax_id) {
         $start = microtime(TRUE);
         $tax_id = trim($tax_id);
-        $this->importRecord($tax_id);
-        $this->addItemsHandled(1);
+        $result = $this->importRecord($tax_id);
+
+        // Only addItemsHandled if the importRecord was a success.
+        if ($result) {
+          $this->addItemsHandled(1);
+        }
 
         $remaining_sleep = $sleep_time - ((int) (1e6 * (microtime(TRUE) - $start)));
         if ($remaining_sleep > 0) {
@@ -862,7 +866,9 @@ class TaxonomyImporter extends TripalImporter {
 
       // Set the indecies for the tree.
       chado_assign_phylogeny_tree_indices($this->tree);
+      return TRUE;
     }
+    return FALSE;
   }
 
   /**