Преглед изворни кода

Merge branch 'feat/size-limit-per-file' into imrpv/remove-redundant-code

utsushiiro пре 7 година
родитељ
комит
96d09b730a
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      src/server/service/file-uploader/gridfs.js

+ 1 - 1
src/server/service/file-uploader/gridfs.js

@@ -68,7 +68,7 @@ module.exports = function(crowi) {
     }
     }
 
 
     const usingFilesSize = await getCollectionSize();
     const usingFilesSize = await getCollectionSize();
-    if (+process.env.MONGO_GRIDFS_TOTAL_LIMIT > usingFilesSize + +uploadFileSize) {
+    if (usingFilesSize + uploadFileSize > +process.env.MONGO_GRIDFS_TOTAL_LIMIT) {
       return { isUploadable: false, errorMessage: 'MongoDB for uploading files reaches limit' };
       return { isUploadable: false, errorMessage: 'MongoDB for uploading files reaches limit' };
     }
     }