diff --git a/utils/scripts/import_13th_floor.pl b/utils/scripts/import_13th_floor.pl index ba55b67eb..c726df7ff 100644 --- a/utils/scripts/import_13th_floor.pl +++ b/utils/scripts/import_13th_floor.pl @@ -104,7 +104,7 @@ sub read_items_file_from_13th_floor_text { $query_insert_ph .= "), "; #::: Let's chunk our updates so we can break up the amount of individual queries - if($query_count > 500){ + if ($query_count > 500){ $query_insert_ph = substr($query_insert_ph, 0, -2); $dbh->prepare($master_insert . " " . $query_insert_ph)->execute(@field_values); $query_count = 0; @@ -113,7 +113,7 @@ sub read_items_file_from_13th_floor_text { } #::: Print updates to console - if($print_cycle > 25){ + if ($print_cycle > 25){ print "Processing (" . $read_items_file . ") :: (Items: " . $total_items . "/" . $total_items_file . ") \r"; $print_cycle = 0; } @@ -124,6 +124,12 @@ sub read_items_file_from_13th_floor_text { $print_cycle++; } + #::: Process remaining items that didn't fill a complete batch + if ($query_count > 0) { + $query_insert_ph = substr($query_insert_ph, 0, -2); + $dbh->prepare($master_insert . " " . $query_insert_ph)->execute(@field_values); + } + #::: One last processing print print "Processing (" . $read_items_file . ") :: (Items: " . $total_items . "/" . $total_items_file . ") \r";