Skip to content

Commit

Permalink
fix long download
Browse files Browse the repository at this point in the history
Running the postinstall script takes around 30s.
It looks like nodejs/node#47228 is the root cause.

Adding a `response.resume()` is a working workaround.
  • Loading branch information
fiji-flo committed Dec 20, 2024
1 parent e1773d7 commit 99e5ff6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/download.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ function download(_url, dest, opts) {
https.get(mergedOpts, response => {
console.log('statusCode: ' + response.statusCode);
if (response.statusCode === 302) {
response.resume();
console.log('Following redirect to: ' + response.headers.location);
return download(response.headers.location, dest, opts)
.then(resolve, reject);
Expand Down

0 comments on commit 99e5ff6

Please sign in to comment.