mirror of
https://github.com/overleaf/overleaf.git
synced 2025-02-21 04:41:39 +00:00
make arguments handling for packworker more robust
This commit is contained in:
parent
cac7556ad5
commit
c26bccd390
2 changed files with 2 additions and 2 deletions
|
@ -61,7 +61,7 @@ app.post "/pack", (req, res, next) ->
|
||||||
else
|
else
|
||||||
logger.log "running pack"
|
logger.log "running pack"
|
||||||
packWorker = child_process.fork(__dirname + '/app/js/PackWorker.js',
|
packWorker = child_process.fork(__dirname + '/app/js/PackWorker.js',
|
||||||
[req.query.limit, req.query.delay, req.query.timeout])
|
[req.query.limit || 1000, req.query.delay || 1000, req.query.timeout || 30*60*1000])
|
||||||
packWorker.on 'exit', (code, signal) ->
|
packWorker.on 'exit', (code, signal) ->
|
||||||
logger.log {code, signal}, "history auto pack exited"
|
logger.log {code, signal}, "history auto pack exited"
|
||||||
packWorker = null
|
packWorker = null
|
||||||
|
|
|
@ -22,7 +22,7 @@ source = process.argv[2]
|
||||||
DOCUMENT_PACK_DELAY = Number(process.argv[3]) || 1000
|
DOCUMENT_PACK_DELAY = Number(process.argv[3]) || 1000
|
||||||
TIMEOUT = Number(process.argv[4]) || 30*60*1000
|
TIMEOUT = Number(process.argv[4]) || 30*60*1000
|
||||||
|
|
||||||
if source.match(/[^0-9]/)
|
if !source.match(/^[0-9]+$/)
|
||||||
file = fs.readFileSync source
|
file = fs.readFileSync source
|
||||||
result = for line in file.toString().split('\n')
|
result = for line in file.toString().split('\n')
|
||||||
[project_id, doc_id] = line.split(' ')
|
[project_id, doc_id] = line.split(' ')
|
||||||
|
|
Loading…
Reference in a new issue