Comments (4)
@sindresorhus I'm kind of against retry functionality in got, yet it come in handy from time to time. Here's why:
retry
will add quite a few options -retryCount
,retryDelay
and etc...- Streams will not support this without buffering and be useless by default (if retry will be enabled by default)
- Same as redirect,
retry
should be enabled only forGET
andHEAD
, right? Should it be configurable?
So it is kind of heavy feature and I believe, that retry should be added consciously by developer.
const retry = require('retry');
const got = require('got');
let result = await retry(() => { return got('google.com'); });
from got.
- Yes, more options would be added, but it is not a bad thing, is it?
- True, but we can mention this behavior explicitly in the docs
retry
would be enabled for all requests, because it would retry requests only on network failures, like EAI_AGAIN, ETIMEDOUT, etc.
So, to sum up, the implementation would be pretty lightweight, but the benefits are obvious. The only point is to deal with network failures, not response failures (interpreting status code, etc).
from got.
I didn't mean we should implement all the retry options. I just want a option-less sane default.
The benefit of including it in core is that all consumers benefit without doing any extra work, or more importantly without having to know it's needed in the first place. Most wouldn't even be aware they should be using retry
with got
. If we decide to recommend it in the readme instead, all got
consumers will have to do the same with their readmes, etc...
from got.
The only point is to deal with network failures, not response failures
@vdemedes then I misunderstood issue a little - in this case streams still can be in game. Cool
from got.
Related Issues (20)
- Got raise an error with "Promise was canceled" and drop the cancel reason
- request retries after receive 200
- openapi types
- Got fails silently returning cached response in a beforeRequest hook while using FormData as request body
- Hostname/IP does not match certificate's altnames HOT 1
- Limit download or upload rate
- Super slow with cache
- audioplayererror [requesterror]: socket hang up got
- statusCodes does not properly limit which requests are retried HOT 1
- Back-port of CVE fix HOT 2
- ECONNEREFUSED or ENOTFOUND crashes the application HOT 2
- Connect timeout fired even though underlying socket is actually connected
- typing issue HOT 2
- Errors on build proccess
- RequestError: unexpected end of file HOT 5
- Every other request library sends headers, except GOT. What am I doing wrong? HOT 3
- Inconsistent types for agent option
- Outdated How to store options section?
- Switch proxy before retry?
- unexpected output to console from post
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from got.