From f8819fbbd775e7db321b5f509301e9662e16929a Mon Sep 17 00:00:00 2001 From: James Allen Date: Thu, 22 May 2014 12:18:56 +0100 Subject: [PATCH] Increase req and res stream timeouts to 3 minutes --- services/clsi/app.coffee | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/services/clsi/app.coffee b/services/clsi/app.coffee index 72748f129b..a17894edbe 100644 --- a/services/clsi/app.coffee +++ b/services/clsi/app.coffee @@ -18,6 +18,15 @@ app = express() app.use Metrics.http.monitor(logger) +# Compile requests can take longer than the default two +# minutes (including file download time), so bump up the +# timeout a bit. +TIMEOUT = threeMinutes = 3 * 60 * 1000 +app.use (req, res, next) -> + req.setTimeout TIMEOUT + res.setTimeout TIMEOUT + next() + app.post "/project/:project_id/compile", bodyParser.json(limit: "5mb"), CompileController.compile app.delete "/project/:project_id", CompileController.clearCache