File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -71,22 +71,20 @@ function onlyFiles(schemas) {
71
71
72
72
function getAllObjects ( baseQuery ) {
73
73
var allObjects = [ ] ;
74
- var next = function ( startIndex ) {
75
- if ( startIndex > 10000 ) {
74
+ var next = function ( ) {
75
+ if ( allObjects . length ) {
76
76
baseQuery . greaterThan ( 'createdAt' , allObjects [ allObjects . length - 1 ] . createdAt ) ;
77
- startIndex = 0 ;
78
77
}
79
- baseQuery . skip ( startIndex ) ;
80
78
return baseQuery . find ( { useMasterKey : true } ) . then ( function ( r ) {
81
79
allObjects = allObjects . concat ( r ) ;
82
80
if ( r . length == 0 ) {
83
81
return Promise . resolve ( allObjects ) ;
84
82
} else {
85
- return next ( startIndex + r . length ) ;
83
+ return next ( ) ;
86
84
}
87
85
} ) ;
88
86
}
89
- return next ( 0 ) ;
87
+ return next ( ) ;
90
88
}
91
89
92
90
function getObjectsWithFilesFromSchema ( schema ) {
You can’t perform that action at this time.
0 commit comments