Skip to content

Commit 8719cd2

Browse files
authored
no prefetching when wait is false (#15)
1 parent 3f6aeef commit 8719cd2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/streams.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class BlobReadStream extends Readable {
9292
this.id = id
9393
this.core = core.session({ wait: opts.wait, timeout: opts.timeout })
9494

95-
this._prefetch = opts.prefetch
95+
this._prefetch = opts.wait === false ? noPrefetch : opts.prefetch
9696
this._lastPrefetch = null
9797
if (!this._prefetch) {
9898
const prefetcher = new SparsePrefetcher(opts)
@@ -174,3 +174,7 @@ module.exports = {
174174
}
175175

176176
function noop () {}
177+
178+
function noPrefetch () {
179+
return null
180+
}

0 commit comments

Comments
 (0)