mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-02 21:59:00 +02:00
pause stream while writing to mongo
This commit is contained in:
@@ -57,7 +57,9 @@ module.exports = MongoAWS =
|
||||
if line.length > 2
|
||||
ops.push(JSON.parse(line))
|
||||
if ops.length == MongoAWS.bulkLimit
|
||||
download.pause()
|
||||
MongoAWS.handleBulk ops.slice(0), () ->
|
||||
download.resume()
|
||||
ops.splice(0,ops.length)
|
||||
.on 'end', () ->
|
||||
MongoAWS.handleBulk ops, callback
|
||||
|
||||
Reference in New Issue
Block a user