Yuki Takei 5 лет назад
Родитель
Сommit
aa86b11468
1 измененных файлов с 6 добавлено и 2 удалено
  1. 6 2
      src/server/service/export.js

+ 6 - 2
src/server/service/export.js

@@ -205,8 +205,12 @@ class ExportService {
   async exportCollectionsToZippedJson(collections) {
     const metaJson = await this.createMetaJson();
 
-    const promises = collections.map(collectionName => this.exportCollectionToJson(collectionName));
-    const jsonFiles = await Promise.all(promises);
+    // sequencial read
+    const jsonFiles = [];
+    const jsonFilesPromises = collections.map(collectionName => this.exportCollectionToJson(collectionName));
+    for await (const jsonFile of jsonFilesPromises) {
+      jsonFiles.push(jsonFile);
+    }
 
     // send terminate event
     this.emitStartZippingEvent();