From 541dac11cbd70b0ffa4d220cfcd15a8904e420cb Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Tue, 8 Jan 2019 12:56:16 +0000 Subject: [PATCH] pull clsi compile size limit into setting and bump to 7mb --- app.coffee | 4 ++-- config/settings.defaults.coffee | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app.coffee b/app.coffee index 10bceee..f81021e 100644 --- a/app.coffee +++ b/app.coffee @@ -58,7 +58,7 @@ app.param 'build_id', (req, res, next, build_id) -> next new Error("invalid build id #{build_id}") -app.post "/project/:project_id/compile", bodyParser.json(limit: "5mb"), CompileController.compile +app.post "/project/:project_id/compile", bodyParser.json(limit: Settings.compileSizeLimit), CompileController.compile app.post "/project/:project_id/compile/stop", CompileController.stopCompile app.delete "/project/:project_id", CompileController.clearCache @@ -68,7 +68,7 @@ app.get "/project/:project_id/wordcount", CompileController.wordcount app.get "/project/:project_id/status", CompileController.status # Per-user containers -app.post "/project/:project_id/user/:user_id/compile", bodyParser.json(limit: "5mb"), CompileController.compile +app.post "/project/:project_id/user/:user_id/compile", bodyParser.json(limit: Settings.compileSizeLimit), CompileController.compile app.post "/project/:project_id/user/:user_id/compile/stop", CompileController.stopCompile app.delete "/project/:project_id/user/:user_id", CompileController.clearCache diff --git a/config/settings.defaults.coffee b/config/settings.defaults.coffee index 88f4532..ad3f04d 100644 --- a/config/settings.defaults.coffee +++ b/config/settings.defaults.coffee @@ -15,6 +15,8 @@ module.exports = retry: max: 10 + compileSizeLimit: process.env["COMPILE_SIZE_LIMIT"] or "7mb" + path: compilesDir: Path.resolve(__dirname + "/../compiles") clsiCacheDir: Path.resolve(__dirname + "/../cache") @@ -32,6 +34,7 @@ module.exports = apis: clsi: url: "http://#{process.env['CLSI_HOST'] or 'localhost'}:3013" + smokeTest: process.env["SMOKE_TEST"] or false project_cache_length_ms: 1000 * 60 * 60 * 24