File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ export class ServerSideStream extends Readable {
1414 private finished = false ;
1515 private processingData = false ;
1616 private inputPaused = false ;
17- private readonly maxPendingRows = 5 ; // Limit pending rows to prevent memory buildup
17+ private readonly bufferGrowthThreshold = 10 ; // Stop adding to buffer when over this many rows are already in
1818 private lineBuffer = "" ;
1919 private sourceStream : NodeJS . ReadableStream | null = null ;
2020
@@ -68,7 +68,7 @@ export class ServerSideStream extends Readable {
6868
6969 // Apply backpressure if we have too many pending rows
7070 if (
71- this . pendingRows . length > this . maxPendingRows &&
71+ this . pendingRows . length > this . bufferGrowthThreshold &&
7272 this . sourceStream &&
7373 ! this . inputPaused &&
7474 ! this . processingData
@@ -182,7 +182,7 @@ export class ServerSideStream extends Readable {
182182 if (
183183 this . sourceStream &&
184184 this . inputPaused &&
185- this . pendingRows . length < this . maxPendingRows / 4
185+ this . pendingRows . length < this . bufferGrowthThreshold
186186 ) {
187187 this . sourceStream . resume ( ) ;
188188 this . inputPaused = false ;
You can’t perform that action at this time.
0 commit comments