make arguments handling for packworker more robust
This commit is contained in:
@@ -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(' ')
|
||||
|
||||
Reference in New Issue
Block a user