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

Add support for retry condition in retry effect #1760

Open
xmile1 opened this issue Feb 1, 2019 · 6 comments
Open

Add support for retry condition in retry effect #1760

xmile1 opened this issue Feb 1, 2019 · 6 comments

Comments

@xmile1
Copy link

xmile1 commented Feb 1, 2019

If I am not missing some information about the awesome retry effect, It would be nice to have it work with conditions.
A use case would be if I do not want to retry on a certain errors status.

My suggestion is to add a callback with the error object, as one of the argument in the retry function

retry(maxTries, delay, condition, fn, ...args)
const condition = (error)=> !error.response.status === 503
const response = yield retry(3, 1000 * 10, condition, request, data)
@Andarist
Copy link
Member

Andarist commented Feb 1, 2019

We could consider it, but unfortunately the proposed API would be a breaking change right now.

@ZiggStardust
Copy link

ZiggStardust commented Dec 10, 2019

I'd also like tho see this feature implemented, there are some valid use cases for controlling when this effect should retry.

@mrboli
Copy link

mrboli commented Aug 25, 2020

This should be part of the API

@mi-mazouz
Copy link

need this feature too!

@neurosnap
Copy link
Member

I’d be happy to review any new proposals for this feature.

@JatinRanka
Copy link

@neurosnap @Andarist I would like to contribute to this issue if there are still plans to add this feature.

One way I am thinking to solve this is via adding the error condition in q10 function of packages/core/src/internal/sagaHelpers/retry.js file. Let me know if this is the right approach?

PS: This is going to be my first open-source contribution, so I am not much aware of the processes involved and where to discuss this. Any help would be really appreciated :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants