mirror of
https://github.com/overleaf/overleaf.git
synced 2025-01-28 23:22:35 +00:00
cleanup and comments
This commit is contained in:
parent
63ee4d1e7d
commit
9aaef729ad
2 changed files with 3 additions and 1 deletions
|
@ -1,7 +1,7 @@
|
|||
_ = require("underscore")
|
||||
metrics = require("metrics-sharelatex")
|
||||
logger = require("logger-sharelatex")
|
||||
safe_exec = require('./SafeExec')
|
||||
safe_exec = require("./SafeExec")
|
||||
approvedFormats = ["png"]
|
||||
|
||||
fourtySeconds = 40 * 1000
|
||||
|
|
|
@ -9,6 +9,7 @@ child_process = require('child_process')
|
|||
# group, then we can kill everything in that process group.
|
||||
|
||||
module.exports = (command, options, callback = (err, stdout, stderr) ->) ->
|
||||
# options are {timeout: number-of-milliseconds, killSignal: signal-name}
|
||||
[cmd, args...] = command.split(' ')
|
||||
|
||||
child = child_process.spawn cmd, args, {detached:true}
|
||||
|
@ -22,6 +23,7 @@ module.exports = (command, options, callback = (err, stdout, stderr) ->) ->
|
|||
if options.timeout?
|
||||
killTimer = setTimeout () ->
|
||||
try
|
||||
# use negative process id to kill process group
|
||||
process.kill -child.pid, options.killSignal || "SIGTERM"
|
||||
catch error
|
||||
logger.log process: child.pid, kill_error: error, "error killing process"
|
||||
|
|
Loading…
Reference in a new issue