Comments (1)
The problem is that you need to wrap your call to rp
in a function like this:
retry(function() { return rp('http://localhost:8000').promise() }, { max_tries: 5 })
.then(function (res) {
console.log('success');
})
.catch(function (err) {
console.log('fail');
});
The way you wrote it would only call request-promise once in the global context which returns the single promise that's then passed into bluebird-retry, but there's nothing to actually retry, hence it only issues the request once.
from bluebird-retry.
Related Issues (20)
- The `basic usage` example dose not output the correct result HOT 1
- bluebird as peer dependency HOT 1
- bluebird as s peer dependency
- Compatibility issues in older browsers and reserved keywords HOT 2
- Error "Fatal TypeError: func is not a function" HOT 4
- Feature request: retry returns Promise HOT 2
- Exceeding "max_tries" throws "Fatal undefined" HOT 1
- Seems doesn't work with bluebird Promise.join HOT 2
- Would you consider using fn.apply() instead of fn()? HOT 4
- webpack compliance HOT 3
- Allow chaining HOT 3
- Update project to use webpack HOT 3
- external interface is missing HOT 1
- Promise all is not working
- standard Javascript-Errors lead to timeouts
- Retry on condition HOT 1
- Does it working with Bluebird 3? HOT 1
- Add way to run code between each retry attempt
- Change args on Retry?
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 bluebird-retry.