summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordisconn3ct <[email protected]>2021-12-23 20:17:50 +0300
committerdisconn3ct <[email protected]>2021-12-23 20:17:50 +0300
commit5c568f02c48831b2ee60a665293112fe73939229 (patch)
treec0f798390314268045f52163bc242f1e6591d8cb
parent39e0fa929a65e268d89b1093fa9dd05f1f9a1ec3 (diff)
fix: avoid an extra close-open-close at the end
-rw-r--r--init.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/init.php b/init.php
index 78661ec..5a117c0 100644
--- a/init.php
+++ b/init.php
@@ -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) {