mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
pause stream while writing to mongo
This commit is contained in:
parent
70200a9cf1
commit
dfa0036507
1 changed files with 2 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue