diff options
author | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2020-04-17 14:27:46 +0300 |
---|---|---|
committer | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2020-04-20 21:54:31 +0300 |
commit | 64cbc9911dfd43af0c29034d92656b55bc16217a (patch) | |
tree | c2a631aa7ffdf92924d8b911b7a48a4ccadd77bb /src | |
parent | ee1d700a9bc764c86502978b5538df44aaa66905 (diff) | |
download | qtlocation-mapboxgl-64cbc9911dfd43af0c29034d92656b55bc16217a.tar.gz |
[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.
Diffstat (limited to 'src')
-rw-r--r-- | src/mbgl/util/http_timeout.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mbgl/util/http_timeout.cpp b/src/mbgl/util/http_timeout.cpp index 04842e48be..cf4085d5dc 100644 --- a/src/mbgl/util/http_timeout.cpp +++ b/src/mbgl/util/http_timeout.cpp @@ -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) { + } + if (expires) { return std::max(Seconds::zero(), *expires - util::now()); - } else { - return Duration::max(); } + return Duration::max(); } } // namespace http |