File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -923,18 +923,21 @@ class ParseQuery {
923
923
}
924
924
925
925
let finished = false ;
926
+ let previousResults = [ ] ;
926
927
return continueWhile ( ( ) => {
927
928
return ! finished ;
928
929
} , ( ) => {
929
- return query . find ( findOptions ) . then ( ( results ) => {
930
- return Promise . resolve ( callback ( results ) ) . then ( ( ) => {
931
- if ( results . length >= query . _limit ) {
932
- query . greaterThan ( 'objectId' , results [ results . length - 1 ] . id ) ;
933
- } else {
930
+ return Promise . all ( [
931
+ query . find ( findOptions ) ,
932
+ Promise . resolve ( callback ( previousResults ) ) ] )
933
+ . then ( ( [ results ] ) => {
934
+ if ( results . length == 0 ) {
934
935
finished = true ;
936
+ } else {
937
+ query . greaterThan ( 'objectId' , results [ results . length - 1 ] . id ) ;
938
+ previousResults = results ;
935
939
}
936
940
} ) ;
937
- } ) ;
938
941
} ) ;
939
942
}
940
943
You can’t perform that action at this time.
0 commit comments