reduced timeout to 20 seconds

This commit is contained in:
Henry Oswald 2014-02-20 11:45:51 +00:00
parent 99e15dc12f
commit 159670a3d4
2 changed files with 5 additions and 5 deletions

View file

@ -4,7 +4,7 @@ logger = require("logger-sharelatex")
exec = require('child_process').exec exec = require('child_process').exec
approvedFormats = ["png"] approvedFormats = ["png"]
fourMinsInMs = 4 * (60 * 1000) twentySeconds = 20 * 1000
module.exports = module.exports =
@ -18,7 +18,7 @@ module.exports =
return callback err return callback err
args = "nice convert -flatten -density 300 #{sourcePath} #{destPath}" args = "nice convert -flatten -density 300 #{sourcePath} #{destPath}"
opts = opts =
timeout: fourMinsInMs timeout: twentySeconds
exec args, opts, (err, stdout, stderr)-> exec args, opts, (err, stdout, stderr)->
timer.done() timer.done()
if err? if err?
@ -38,7 +38,7 @@ module.exports =
height: 300 height: 300
args = "nice convert -flatten -background white -resize 260x -density 300 #{sourcePath} #{destPath}" args = "nice convert -flatten -background white -resize 260x -density 300 #{sourcePath} #{destPath}"
opts = opts =
timeout: fourMinsInMs timeout: twentySeconds
exec args, opts,(err, stdout, stderr)-> exec args, opts,(err, stdout, stderr)->
if err? if err?
logger.err err:err, stderr:stderr, sourcePath:sourcePath, "something went wrong converting file to preview" logger.err err:err, stderr:stderr, sourcePath:sourcePath, "something went wrong converting file to preview"
@ -57,7 +57,7 @@ module.exports =
height: 849 height: 849
args = "nice convert -flatten -background white -resize 548x -density 300 #{sourcePath} #{destPath}" args = "nice convert -flatten -background white -resize 548x -density 300 #{sourcePath} #{destPath}"
opts = opts =
timeout: fourMinsInMs timeout: twentySeconds
exec args, opts,(err, stdout, stderr)-> exec args, opts,(err, stdout, stderr)->
if err? if err?
logger.err err:err, stderr:stderr, sourcePath:sourcePath, "something went wrong converting file to preview" logger.err err:err, stderr:stderr, sourcePath:sourcePath, "something went wrong converting file to preview"

View file

@ -9,7 +9,7 @@ module.exports =
logger.log localPath:localPath, "optimising png path" logger.log localPath:localPath, "optimising png path"
args = "optipng #{localPath}" args = "optipng #{localPath}"
opts = opts =
timeout: 60 * 1000 timeout: 20 * 1000
exec args, opts,(err, stdout, stderr)-> exec args, opts,(err, stdout, stderr)->
if err? if err?
logger.err err:err, stderr:stderr, localPath:localPath, "something went wrong converting compressPng" logger.err err:err, stderr:stderr, localPath:localPath, "something went wrong converting compressPng"