|
|
@@ -6,7 +6,7 @@ module.exports = function(crowi) {
|
|
|
const Uploader = require('./uploader');
|
|
|
const lib = new Uploader(crowi);
|
|
|
const COLLECTION_NAME = 'attachmentFiles';
|
|
|
- // const CHUNK_COLLECTION_NAME = `${COLLECTION_NAME}.chunks`;
|
|
|
+ const CHUNK_COLLECTION_NAME = `${COLLECTION_NAME}.chunks`;
|
|
|
|
|
|
// instantiate mongoose-gridfs
|
|
|
const { createModel } = require('mongoose-gridfs');
|
|
|
@@ -16,7 +16,7 @@ module.exports = function(crowi) {
|
|
|
connection: mongoose.connection,
|
|
|
});
|
|
|
// get Collection instance of chunk
|
|
|
- // const chunkCollection = mongoose.connection.collection(CHUNK_COLLECTION_NAME);
|
|
|
+ const chunkCollection = mongoose.connection.collection(CHUNK_COLLECTION_NAME);
|
|
|
|
|
|
// create promisified method
|
|
|
AttachmentFile.promisifiedWrite = util.promisify(AttachmentFile.write).bind(AttachmentFile);
|
|
|
@@ -44,9 +44,10 @@ module.exports = function(crowi) {
|
|
|
};
|
|
|
|
|
|
lib.deleteFiles = async function(attachments) {
|
|
|
- attachments.map(async(attachment) => {
|
|
|
- return lib.deleteFile(attachment);
|
|
|
- });
|
|
|
+ // attachments.map(async(attachment) => {
|
|
|
+ // return lib.deleteFile(attachment);
|
|
|
+ // });
|
|
|
+
|
|
|
};
|
|
|
|
|
|
/**
|