summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfox <[email protected]>2021-12-25 15:36:14 +0300
committerfox <[email protected]>2021-12-25 15:36:14 +0300
commit40bb22328835fbd604abace34233bb95df6d7297 (patch)
treec0f798390314268045f52163bc242f1e6591d8cb
parent030e7f3fb202c1bd81d59085e0cf4de756d92531 (diff)
parent5c568f02c48831b2ee60a665293112fe73939229 (diff)
Merge pull request 'fix: lower memory use' (#3) from disconn3ct/ttrss-data-migration:fix/memory-use into master
Reviewed-on: https://git.tt-rss.org/fox/ttrss-data-migration/pulls/3
-rw-r--r--init.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/init.php b/init.php
index 4d17845..5a117c0 100644
--- a/init.php
+++ b/init.php
@@ -175,6 +175,18 @@ class Data_Migration extends Plugin {
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");
+ exit(3);
+ }
+ $zip = new ZipArchive();
+
+ if ($zip->open($output_file) !== TRUE) {
+ Debug::log("unable to reopen $output_file");
+ exit(3);
+ }
}
if ($zip->close() !== TRUE) {