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

Is support different request instances retry different count? #44

Open
yfming93 opened this issue Oct 17, 2024 · 3 comments
Open

Is support different request instances retry different count? #44

yfming93 opened this issue Oct 17, 2024 · 3 comments

Comments

@yfming93
Copy link

Is support different request instances retry different count?

@yfming93
Copy link
Author

yfming93 commented Oct 17, 2024

eg:
The request instance 'https://mock.codes/xxx' retry 2 count.
Another request instance 'https://mock.codes/yyy' retry 3 count.

@DmitryGaimaldinov
Copy link

@yfming93, please, put your sample code here.

If you want to have different count on different requests you have to create multiple Dio instances. Each of them will have it's own RetryInterceptor. And then you choose which dio instance to use

@rodion-m
Copy link
Owner

rodion-m commented Oct 21, 2024

It should be possible, as I remember. Just pass retry count for a specific request.
Like this:

  final request = RequestOptions(path: '/')
    ..retries = 4;

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

No branches or pull requests

3 participants