diff --git a/lib/streams.js b/lib/streams.js index 6baccdc..d662b39 100644 --- a/lib/streams.js +++ b/lib/streams.js @@ -92,7 +92,7 @@ class BlobReadStream extends Readable { this.id = id this.core = core.session({ wait: opts.wait, timeout: opts.timeout }) - this._prefetch = opts.prefetch + this._prefetch = opts.wait === false ? noPrefetch : opts.prefetch this._lastPrefetch = null if (!this._prefetch) { const prefetcher = new SparsePrefetcher(opts) @@ -174,3 +174,7 @@ module.exports = { } function noop () {} + +function noPrefetch () { + return null +}