-
-
Notifications
You must be signed in to change notification settings - Fork 957
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
timeouts not working as expected #215
Comments
I should also note that needle (another minimal HTTP request library I am looking at) does timeouts correctly as well. This code terminates after 500ms 👍// note that I manually promisified this code, which isn't shown
const url = 'http://10.155.155.155';
const options = {
timeout: 500
};
needle.get(url, options).then(function(res) {
console.log(res.body);
}).catch(function (err) {
console.error(err);
}) Output:
|
@MarkHerhold |
Ah! Novice mistake. Thanks @floatdrop |
Please write about it in documentation. It's totally unclear. |
Still an issue. Timeout is not respected when it is greater than 1000ms.
|
Reopening for @pasupulaphani |
@pasupulaphani can you tell, what is expected? I've tested this with added |
@floatdrop Sorry for the false alarm. Looks like I made mistake. Not a bug. |
Can you provide a full example how to make timeouts work properly without retries? The following code takes ~8 secs to run:
I've also tried This gotcha! should be mentioned also in the documentation for |
@plaa it's
result |
I'm looking at switching from
request
togot
due to massive amount of bloat. It looks like timeouts don't behave the same way ingot
and am wondering what the issue is.Versions: got v6.3.0 on node.js v6.3.1.
This code never terminates 👎
This code terminates after 500ms 👍
Note that the IP is just some garbage IP address that is not assigned to anything. Any help would be appreciated. Thanks!
The text was updated successfully, but these errors were encountered: