resolveDelays static method
Resolves retry delays, preferring a request-local schedule.
Implementation
static List<Duration> resolveDelays(RequestOptions options) {
final raw = options.extra['retryDelays'];
if (raw is List) {
final seconds = raw.whereType<int>().map(
(value) => value < 0 ? 0 : value,
);
final resolved = seconds
.map((value) => Duration(seconds: value))
.toList(growable: false);
if (resolved.isNotEmpty) return resolved;
}
return LikeConstants.retryDelays
.map((seconds) => Duration(seconds: seconds < 0 ? 0 : seconds))
.toList(growable: false);
}