bandwidth-throttle-stream icon indicating copy to clipboard operation
bandwidth-throttle-stream copied to clipboard

When I try to use the throttle I get Maximum call stack size exceeded

Open nkostadinov opened this issue 3 years ago • 0 comments

I cereate the file varuable via createReadStream. It is working normally without the throtling.

            const bandwidthThrottleGroup = createBandwidthThrottleGroup({
                bytesPerSecond: rate
            });
            const throttle = bandwidthThrottleGroup.createBandwidthThrottle(item.meta.fileSize);

            file
                .pipe(throttle)
                .pipe(writable)

and then when I try to limit the bandwidth I get this error

RangeError: Maximum call stack size exceeded
    at Array.push (<anonymous>)
    at getFrequencyPerDivision (****\node_modules\bandwidth-throttle-stream\src\Util\evenlyDistributeSets.ts:91:17)
    at getFrequencyPerDivision (****\node_modules\bandwidth-throttle-stream\src\Util\evenlyDistributeSets.ts:99:12)
    at getFrequencyPerDivision (****\node_modules\bandwidth-throttle-stream\src\Util\evenlyDistributeSets.ts:99:12)
    at getFrequencyPerDivision (****\node_modules\bandwidth-throttle-stream\src\Util\evenlyDistributeSets.ts:99:12)
    at getFrequencyPerDivision (****\node_modules\bandwidth-throttle-stream\src\Util\evenlyDistributeSets.ts:99:12)
    at getFrequencyPerDivision (****\node_modules\bandwidth-throttle-stream\src\Util\evenlyDistributeSets.ts:99:12)
    at getFrequencyPerDivision (****\node_modules\bandwidth-throttle-stream\src\Util\evenlyDistributeSets.ts:99:12)
    at getFrequencyPerDivision (****\node_modules\bandwidth-throttle-stream\src\Util\evenlyDistributeSets.ts:99:12)
    at getFrequencyPerDivision (****\node_modules\bandwidth-throttle-stream\src\Util\evenlyDistributeSets.ts:99:12)

nkostadinov avatar Jun 09 '22 12:06 nkostadinov