[core] Introduce Resource::minimumUpdateInterval
Introduce `Resource::minimumUpdateInterval` and consider it in the online file source. The `minimumUpdateInterval` is used to throttle the requests, which were initiated due to resource expiration.
This commit is contained in:
@@ -32,11 +32,11 @@ Duration errorRetryTimeout(Response::Error::Reason failedRequestReason, uint32_t
|
||||
Duration expirationTimeout(optional<Timestamp> expires, uint32_t expiredRequests) {
|
||||
if (expiredRequests) {
|
||||
return Seconds(1u << std::min(expiredRequests - 1, 31u));
|
||||
} else if (expires) {
|
||||
return std::max(Seconds::zero(), *expires - util::now());
|
||||
} else {
|
||||
return Duration::max();
|
||||
}
|
||||
if (expires) {
|
||||
return std::max(Seconds::zero(), *expires - util::now());
|
||||
}
|
||||
return Duration::max();
|
||||
}
|
||||
|
||||
} // namespace http
|
||||
|
||||
Reference in New Issue
Block a user