diff options
author | disconn3ct <[email protected]> | 2021-12-23 20:17:50 +0300 |
---|---|---|
committer | disconn3ct <[email protected]> | 2021-12-23 20:17:50 +0300 |
commit | 5c568f02c48831b2ee60a665293112fe73939229 (patch) | |
tree | c0f798390314268045f52163bc242f1e6591d8cb | |
parent | 39e0fa929a65e268d89b1093fa9dd05f1f9a1ec3 (diff) |
fix: avoid an extra close-open-close at the end
-rw-r--r-- | init.php | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -173,6 +173,9 @@ class Data_Migration extends Plugin { $zip->addFromString($batch_filename, json_encode($batch)); + if (count($batch["articles"]) != $batch_size) + break; + // flush all that used memory if ($zip->close() !== TRUE) { Debug::log("write error while saving data to $output_file"); @@ -184,8 +187,6 @@ class Data_Migration extends Plugin { Debug::log("unable to reopen $output_file"); exit(3); } - if (count($batch["articles"]) != $batch_size) - break; } if ($zip->close() !== TRUE) { |