mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
cranked up kill to child processes to killSignal: "SIGKILL"
This commit is contained in:
parent
0306a3ad4a
commit
94a6504635
2 changed files with 9 additions and 10 deletions
|
@ -6,6 +6,10 @@ approvedFormats = ["png"]
|
||||||
|
|
||||||
twentySeconds = 20 * 1000
|
twentySeconds = 20 * 1000
|
||||||
|
|
||||||
|
childProcessOpts =
|
||||||
|
killSignal: "SIGKILL"
|
||||||
|
timeout: twentySeconds
|
||||||
|
|
||||||
module.exports =
|
module.exports =
|
||||||
|
|
||||||
convert: (sourcePath, requestedFormat, callback)->
|
convert: (sourcePath, requestedFormat, callback)->
|
||||||
|
@ -17,9 +21,7 @@ module.exports =
|
||||||
err = new Error("invalid format requested")
|
err = new Error("invalid format requested")
|
||||||
return callback err
|
return callback err
|
||||||
args = "nice convert -flatten -density 300 #{sourcePath} #{destPath}"
|
args = "nice convert -flatten -density 300 #{sourcePath} #{destPath}"
|
||||||
opts =
|
exec args, childProcessOpts, (err, stdout, stderr)->
|
||||||
timeout: twentySeconds
|
|
||||||
exec args, opts, (err, stdout, stderr)->
|
|
||||||
timer.done()
|
timer.done()
|
||||||
if err?
|
if err?
|
||||||
logger.err err:err, stderr:stderr, sourcePath:sourcePath, requestedFormat:requestedFormat, destPath:destPath, "something went wrong converting file"
|
logger.err err:err, stderr:stderr, sourcePath:sourcePath, requestedFormat:requestedFormat, destPath:destPath, "something went wrong converting file"
|
||||||
|
@ -37,9 +39,7 @@ module.exports =
|
||||||
width: 424
|
width: 424
|
||||||
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 =
|
exec args, childProcessOpts, (err, stdout, stderr)->
|
||||||
timeout: twentySeconds
|
|
||||||
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"
|
||||||
else
|
else
|
||||||
|
@ -56,9 +56,7 @@ module.exports =
|
||||||
width: 600
|
width: 600
|
||||||
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 =
|
exec args, childProcessOpts, (err, stdout, stderr)->
|
||||||
timeout: twentySeconds
|
|
||||||
exec args, opts,(err, stdout, stderr)->
|
|
||||||
if err?
|
if err?
|
||||||
logger.err err:err, stderr:stderr, sourcePath:sourcePath, destPath:destPath, "something went wrong converting file to preview"
|
logger.err err:err, stderr:stderr, sourcePath:sourcePath, destPath:destPath, "something went wrong converting file to preview"
|
||||||
else
|
else
|
||||||
|
|
|
@ -10,6 +10,7 @@ module.exports =
|
||||||
args = "optipng #{localPath}"
|
args = "optipng #{localPath}"
|
||||||
opts =
|
opts =
|
||||||
timeout: 20 * 1000
|
timeout: 20 * 1000
|
||||||
|
killSignal: "SIGKILL"
|
||||||
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"
|
||||||
|
|
Loading…
Reference in a new issue