mirror of
https://github.com/EQEmu/Server.git
synced 2026-12-02 21:42:17 +00:00
[scripts] Fix item import script (#5152)
This commit is contained in:
1 file changed
+8
-2
@@ -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";
|
||||
|
||||
|
||||
Reference in new issue
Block a user