From 159670a3d459fd6db55d310d46f18c1685b712ce Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Thu, 20 Feb 2014 11:45:51 +0000 Subject: [PATCH] reduced timeout to 20 seconds --- services/filestore/app/coffee/FileConverter.coffee | 8 ++++---- services/filestore/app/coffee/ImageOptimiser.coffee | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/services/filestore/app/coffee/FileConverter.coffee b/services/filestore/app/coffee/FileConverter.coffee index bb19fbaa16..3093c888c2 100644 --- a/services/filestore/app/coffee/FileConverter.coffee +++ b/services/filestore/app/coffee/FileConverter.coffee @@ -4,7 +4,7 @@ logger = require("logger-sharelatex") exec = require('child_process').exec approvedFormats = ["png"] -fourMinsInMs = 4 * (60 * 1000) +twentySeconds = 20 * 1000 module.exports = @@ -18,7 +18,7 @@ module.exports = return callback err args = "nice convert -flatten -density 300 #{sourcePath} #{destPath}" opts = - timeout: fourMinsInMs + timeout: twentySeconds exec args, opts, (err, stdout, stderr)-> timer.done() if err? @@ -38,7 +38,7 @@ module.exports = height: 300 args = "nice convert -flatten -background white -resize 260x -density 300 #{sourcePath} #{destPath}" opts = - timeout: fourMinsInMs + timeout: twentySeconds exec args, opts,(err, stdout, stderr)-> if err? logger.err err:err, stderr:stderr, sourcePath:sourcePath, "something went wrong converting file to preview" @@ -57,7 +57,7 @@ module.exports = height: 849 args = "nice convert -flatten -background white -resize 548x -density 300 #{sourcePath} #{destPath}" opts = - timeout: fourMinsInMs + timeout: twentySeconds exec args, opts,(err, stdout, stderr)-> if err? logger.err err:err, stderr:stderr, sourcePath:sourcePath, "something went wrong converting file to preview" diff --git a/services/filestore/app/coffee/ImageOptimiser.coffee b/services/filestore/app/coffee/ImageOptimiser.coffee index 4e4947d986..7aece25464 100644 --- a/services/filestore/app/coffee/ImageOptimiser.coffee +++ b/services/filestore/app/coffee/ImageOptimiser.coffee @@ -9,7 +9,7 @@ module.exports = logger.log localPath:localPath, "optimising png path" args = "optipng #{localPath}" opts = - timeout: 60 * 1000 + timeout: 20 * 1000 exec args, opts,(err, stdout, stderr)-> if err? logger.err err:err, stderr:stderr, localPath:localPath, "something went wrong converting compressPng"