mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-04 06:39:02 +02:00
fix bulk insert limit
This commit is contained in:
@@ -59,9 +59,9 @@ module.exports = MongoAWS =
|
||||
.on 'data', (line) ->
|
||||
if line.length > 2
|
||||
ops.push(JSON.parse(line))
|
||||
if ops.length > MongoAWS.bulkLimit
|
||||
MongoAWS.handleBulk ops, () ->
|
||||
ops.splice(0,ops.length)
|
||||
if ops.length == MongoAWS.bulkLimit
|
||||
MongoAWS.handleBulk ops.slice(0), () ->
|
||||
ops.splice(0,ops.length)
|
||||
.on 'end', () ->
|
||||
MongoAWS.handleBulk ops, callback
|
||||
.on 'error', (err) ->
|
||||
@@ -80,7 +80,7 @@ module.exports = MongoAWS =
|
||||
if err?
|
||||
logger.error err:err, "error bulking ReadlineStream"
|
||||
else
|
||||
logger.log result:result, "bulked ReadlineStream"
|
||||
logger.log count:ops.length, result:result, "bulked ReadlineStream"
|
||||
cb(err)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user