Skip to content

Commit

Permalink
fix: streamingTimeout not work on tar download (#362)
Browse files Browse the repository at this point in the history
  • Loading branch information
fengmk2 authored Oct 1, 2021
1 parent de255f2 commit bca0b88
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/download/npm.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ async function getTarballStream(tarballUrl, pkg, options) {
// production mode
debug('[%s@%s] GET streaming %j', pkg.name, pkg.version, tarballUrl);
const result = await get(tarballUrl, {
timeout: options.timeout,
timeout: options.streamingTimeout || options.timeout,
followRedirect: true,
formatRedirectUrl,
streaming: true,
Expand Down Expand Up @@ -422,7 +422,7 @@ async function getTarballStream(tarballUrl, pkg, options) {
await utils.mkdirp(tmpDir);
const tmpFile = path.join(tmpDir, `${name}-${pkg.version}-${uuid.v4()}.tgz`);
const result = await get(tarballUrl, {
timeout: options.timeout,
timeout: options.streamingTimeout || options.timeout,
followRedirect: true,
formatRedirectUrl,
writeStream: fs.createWriteStream(tmpFile),
Expand Down

1 comment on commit bca0b88

@KarovInal
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Please sign in to comment.