Retry interceptor for dio.
aloisdeniel / dio_retry Goto Github PK
View Code? Open in Web Editor NEWRetry interceptor for dio.
License: MIT License
Retry interceptor for dio.
License: MIT License
Hello! I found a bug with a retry callback. The module do only one call of given callback, after that it uses a default callback.
Here is a bugged code:
var shouldRetry = extra.retries > 0 && await extra.retryEvaluator(err);
to fix it we just have to change extra
to options
:
var shouldRetry = extra.retries > 0 && await options.retryEvaluator(err);
Please resolve and release a new version ASAP.
Because dio_retry >=0.1.9-beta depends on dio ^3.0.0 and ucertify_learn depends on dio ^4.0.0-beta4, dio_retry >=0.1.9-beta is forbidden.
So, because ucertify_learn depends on dio_retry ^0.1.9-beta, version solving failed.
I got Invalid constant value.dart(invalid_constant)
for the following line:
retryEvaluator: (error) => error.type != DioErrorType.CANCEL && error.type != DioErrorType.RESPONSE,
How could I fix this error?
We have released version 3.0 of Dio, could you support it ๏ผ We will archive this plugin in the Dio documentation after it supports Dio 3.0. thanks.
I saw the code and followed here: dio_retry
Global retry options
final dio = Dio()
..interceptors.add(RetryInterceptor(
options: const RetryOptions(
retries: 3, // Number of retries before a failure
retryInterval: const Duration(seconds: 1), // Interval between each retry
retryEvaluator: (error) => error.type != DioErrorType.CANCEL && error.type != DioErrorType.RESPONSE, // Evaluating if a retry is necessary regarding the error. It is a good candidate for updating authentication token in case of a unauthorized error (be careful with concurrency though)
)
)
);
but failed when setting up retryEvaluator
I tried to configure like example, but still got the same error.
It's a mistake or I haven't done it correctly, can anyone help me?
I tried retry but it is not supporting the multipart request
related issue cfug/dio#482
Hi, thanks for the package!
Are there any plans for migrating the package to use null safe?
I'd like to be able to control the backoff of the retries. Rather than a duration interval, maybe a intervalEvaluator function could be passed with the number of retries, so a interval can be determined.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.