Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overwrite default timeout #9

Merged
merged 1 commit into from
May 22, 2018
Merged

Overwrite default timeout #9

merged 1 commit into from
May 22, 2018

Conversation

timneutkens
Copy link
Member

As talked about with @leo, the default timeout is apparently rather long (2 minutes). This makes sure everything keeps running when npm starts timing out.

@@ -106,7 +107,7 @@ const loadPackage = (url, authInfo) => new Promise((resolve, reject) => {
reject(e);
}
});
}).on('error', reject);
}).on('error', reject).on('timeout', reject);
Copy link
Member Author

Choose a reason for hiding this comment

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

Setting timeout will only add a timeout event to the event emitter.

See https://nodejs.org/api/http.html#http_http_request_options_callback at the bottom:

Note that setting the timeout option or using the setTimeout() function will not abort the request or do anything besides add a 'timeout' event.

@leo leo self-requested a review May 22, 2018 14:02
@leo leo added the enhancement New feature or request label May 22, 2018
@leo leo changed the title Add timeout Overwrite default timeout May 22, 2018
@leo leo merged commit 0c50126 into vercel:master May 22, 2018
@timneutkens timneutkens deleted the add/timeout branch May 22, 2018 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants