File tree 1 file changed +3
-9
lines changed
1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -557,17 +557,11 @@ function _onNext(error, doc) {
557
557
558
558
if ( this . ctx . _batchDocs . length < this . ctx . options . _populateBatchSize ) {
559
559
// If both `batchSize` and `_populateBatchSize` are huge, calling `next()` repeatedly may
560
- // cause a stack overflow. So make sure we clear the stack regularly.
561
- if ( this . ctx . _batchDocs . length > 0 && this . ctx . _batchDocs . length % 1000 === 0 ) {
562
- return immediate ( ( ) => this . ctx . cursor . next ( ) . then (
563
- res => { _onNext . call ( this , null , res ) ; } ,
564
- err => { _onNext . call ( this , err ) ; }
565
- ) ) ;
566
- }
567
- this . ctx . cursor . next ( ) . then (
560
+ // cause a stack overflow. So make sure we clear the stack.
561
+ immediate ( ( ) => this . ctx . cursor . next ( ) . then (
568
562
res => { _onNext . call ( this , null , res ) ; } ,
569
563
err => { _onNext . call ( this , err ) ; }
570
- ) ;
564
+ ) ) ;
571
565
} else {
572
566
_populateBatch . call ( this ) ;
573
567
}
You can’t perform that action at this time.
0 commit comments