mirror of
https://github.com/overleaf/overleaf.git
synced 2025-01-30 19:00:48 +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
|
||||
logger.log "running pack"
|
||||
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) ->
|
||||
logger.log {code, signal}, "history auto pack exited"
|
||||
packWorker = null
|
||||
|
|
|
@ -22,7 +22,7 @@ source = process.argv[2]
|
|||
DOCUMENT_PACK_DELAY = Number(process.argv[3]) || 1000
|
||||
TIMEOUT = Number(process.argv[4]) || 30*60*1000
|
||||
|
||||
if source.match(/[^0-9]/)
|
||||
if !source.match(/^[0-9]+$/)
|
||||
file = fs.readFileSync source
|
||||
result = for line in file.toString().split('\n')
|
||||
[project_id, doc_id] = line.split(' ')
|
||||
|
|
Loading…
Reference in a new issue