Przeglądaj źródła

delete comment out

zamis 5 lat temu
rodzic
commit
6e8dc32ac0
2 zmienionych plików z 2 dodań i 17 usunięć
  1. 1 10
      src/server/service/attachment.js
  2. 1 7
      src/server/service/page.js

+ 1 - 10
src/server/service/attachment.js

@@ -47,23 +47,14 @@ class AttachmentService {
   async removeAttachment(attachments) {
   async removeAttachment(attachments) {
     const { fileUploadService } = this.crowi;
     const { fileUploadService } = this.crowi;
     const attachmentsCollection = mongoose.connection.collection('attachments');
     const attachmentsCollection = mongoose.connection.collection('attachments');
-    // const attachmentsFilesChunkCollection = mongoose.connection.collection('attachmentFiles.chunks');
-    // const attachmentsFilesFilesColleciton = mongoose.connection.collection('attachmentFiles.files');
     const unorderAttachmentsBulkOp = attachmentsCollection.initializeUnorderedBulkOp();
     const unorderAttachmentsBulkOp = attachmentsCollection.initializeUnorderedBulkOp();
-    // const unorderAttachmentsFilesChunkBulkOp = attachmentsFilesChunkCollection.initializeOrderedBulkOp();
-    // const unorderAttachmentsFilesFilesBulkOp = attachmentsFilesFilesColleciton.initializeOrderedBulkOp();
 
 
     attachments.forEach((attachment) => {
     attachments.forEach((attachment) => {
       fileUploadService.deleteFile(attachment);
       fileUploadService.deleteFile(attachment);
-      // unorderAttachmentsFilesChunkBulkOp.find({ _id: attachment._id }).remove();
-      // unorderAttachmentsFilesFilesBulkOp.find({ _id: attachment._id }).remove();
       unorderAttachmentsBulkOp.find({ _id: attachment._id }).remove();
       unorderAttachmentsBulkOp.find({ _id: attachment._id }).remove();
     });
     });
 
 
-    // await unorderAttachmentsFilesChunkBulkOp.execute();
-    // await unorderAttachmentsFilesFilesBulkOp.execute();
-    await unorderAttachmentsBulkOp.execute();
-    return;
+    return unorderAttachmentsBulkOp.execute();
   }
   }
 
 
 }
 }

+ 1 - 7
src/server/service/page.js

@@ -38,15 +38,9 @@ class PageService {
     const Attachment = this.crowi.model('Attachment');
     const Attachment = this.crowi.model('Attachment');
     const { attachmentService } = this.crowi;
     const { attachmentService } = this.crowi;
 
 
-    // const readable = new Readable({ objectMode: true });
-
-    // readable.push(pageIds);
-    // readable.push(null);
-
-    // readable.on('data', async(chunk) => {
     const attachments = await Attachment.find({ page: pageIds });
     const attachments = await Attachment.find({ page: pageIds });
     attachmentService.removeAttachment(attachments);
     attachmentService.removeAttachment(attachments);
-    // });
+
     return;
     return;
   }
   }