From 57a09d4efc6ae2e93f60d949402be2b9e34f1bb0 Mon Sep 17 00:00:00 2001 From: JJ <3617814+joligario@users.noreply.github.com> Date: Tue, 1 Dec 2026 16:43:33 -1000 Subject: [PATCH] [scripts] Fix item import script (#5152) --- utils/scripts/import_13th_floor.pl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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";