Merge pull request #1366 from sharelatex/ho-bump-compile-size

Bump compile size

GitOrigin-RevId: 087e8556a7e2e39bed486cdd8829bf427aaed68b
This commit is contained in:
Henry Oswald 2019-01-08 16:19:25 +00:00 committed by sharelatex
parent 563cdfd439
commit 68a0ff08ea
3 changed files with 6 additions and 3 deletions

View file

@ -1,5 +1,6 @@
_ = require("lodash")
async = require("async")
settings = require("settings-sharelatex")
module.exports = ClsiFormatChecker =
@ -39,7 +40,7 @@ module.exports = ClsiFormatChecker =
_checkDocsAreUnderSizeLimit: (resources, callback)->
FIVEMB = 1000 * 1000 * 5
sizeLimit = 1000 * 1000 * settings.compileBodySizeLimitMb
totalSize = 0
@ -53,7 +54,7 @@ module.exports = ClsiFormatChecker =
totalSize += result.size
return result
tooLarge = totalSize > FIVEMB
tooLarge = totalSize > sizeLimit
if !tooLarge
return callback()
else

View file

@ -488,6 +488,8 @@ module.exports = settings =
# currentImage: "texlive-full:2017.1"
# imageRoot: "<DOCKER REPOSITORY ROOT>" # without any trailing slash
compileBodySizeLimitMb: process.env['COMPILE_BODY_SIZE_LIMIT_MB'] or 5
# allowedImageNames: [
# {imageName: 'texlive-full:2017.1', imageDesc: 'TeXLive 2017'}

View file

@ -8,7 +8,7 @@ SandboxedModule = require('sandboxed-module')
describe "ClsiFormatChecker", ->
beforeEach ->
@ClsiFormatChecker = SandboxedModule.require modulePath, requires:
"settings-sharelatex": @settings ={}
"settings-sharelatex": @settings = { compileBodySizeLimitMb: 5 }
"logger-sharelatex": @logger = { log: sinon.stub(), error: sinon.stub(), warn: sinon.stub() }
@project_id = "project-id"