Taichi Masuyama 3 лет назад
Родитель
Сommit
4c18237e08
1 измененных файлов с 13 добавлено и 13 удалено
  1. 13 13
      packages/app/src/server/service/g2g-transfer.ts

+ 13 - 13
packages/app/src/server/service/g2g-transfer.ts

@@ -219,19 +219,6 @@ export class G2GTransferPusherService implements Pusher {
   }
 
   public async startTransfer(tk: TransferKey, user: any, toGROWIInfo: IDataGROWIInfo, collections: string[], optionsMap: any): Promise<void> {
-    let zipFileStream: ReadStream;
-    try {
-      const shouldEmit = false;
-      const zipFileStat = await this.crowi.exportService.export(collections, shouldEmit);
-      const zipFilePath = zipFileStat.zipFilePath;
-
-      zipFileStream = createReadStream(zipFilePath);
-    }
-    catch (err) {
-      logger.error(err);
-      throw err;
-    }
-
     if (toGROWIInfo.attachmentInfo.type === 'none') {
       try {
         const targetConfigKeys = [
@@ -258,6 +245,19 @@ export class G2GTransferPusherService implements Pusher {
       }
     }
 
+    let zipFileStream: ReadStream;
+    try {
+      const shouldEmit = false;
+      const zipFileStat = await this.crowi.exportService.export(collections, shouldEmit);
+      const zipFilePath = zipFileStat.zipFilePath;
+
+      zipFileStream = createReadStream(zipFilePath);
+    }
+    catch (err) {
+      logger.error(err);
+      throw err;
+    }
+
     // Send a zip file to other growi via axios
     try {
       // Use FormData to immitate browser's form data object