File tree Expand file tree Collapse file tree 1 file changed +0
-9
lines changed Expand file tree Collapse file tree 1 file changed +0
-9
lines changed Original file line number Diff line number Diff line change @@ -74,20 +74,12 @@ export async function collectCursorUntilMaxBytesLimit<T = unknown>({
7474
7575 let wasCapped : boolean = false ;
7676 let totalBytes = 0 ;
77- let biggestDocSizeSoFar = 0 ;
7877 const bufferedDocuments : T [ ] = [ ] ;
7978 while ( true ) {
8079 if ( abortSignal ?. aborted ) {
8180 break ;
8281 }
8382
84- // This is an eager attempt to validate that fetching the next document
85- // won't exceed the applicable limit.
86- if ( totalBytes + biggestDocSizeSoFar >= maxBytesPerQuery ) {
87- wasCapped = true ;
88- break ;
89- }
90-
9183 // If the cursor is empty then there is nothing for us to do anymore.
9284 const nextDocument = await cursor . tryNext ( ) ;
9385 if ( ! nextDocument ) {
@@ -101,7 +93,6 @@ export async function collectCursorUntilMaxBytesLimit<T = unknown>({
10193 }
10294
10395 totalBytes += nextDocumentSize ;
104- biggestDocSizeSoFar = Math . max ( biggestDocSizeSoFar , nextDocumentSize ) ;
10596 bufferedDocuments . push ( nextDocument ) ;
10697 }
10798
You can’t perform that action at this time.
0 commit comments