summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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) {