diff options
author | Julian Andres Klode <julian.klode@canonical.com> | 2021-07-08 16:49:20 +0200 |
---|---|---|
committer | Julian Andres Klode <julian.klode@canonical.com> | 2021-07-28 13:04:10 +0200 |
commit | 121ccd0e0c2612bab9ba5383d5599b54e29e4643 (patch) | |
tree | 2ea80ee1db0f6878e53068961f6b68e1bb0d0840 /apt-pkg/acquire-item.cc | |
parent | 363e3a4c91da353d99cf1af3d5089c9455d461de (diff) |
Implement exponential delay between retries
Add a new Item field called FetchAfter, which determines the earliest
time the item should be fetched at. Adjust insertion into queue to
take it into account alongside priority, and only fill pipelines
with items that are ready.
Diffstat (limited to 'apt-pkg/acquire-item.cc')
-rw-r--r-- | apt-pkg/acquire-item.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index 7c23434ae..20d80edc0 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -290,6 +290,7 @@ public: std::vector<std::string> BadAlternativeSites; std::vector<std::string> PastRedirections; std::unordered_map<std::string, std::string> CustomFields; + time_t FetchAfter = 0; Private() { @@ -1120,6 +1121,15 @@ std::string pkgAcquire::Item::HashSum() const /*{{{*/ return hs != NULL ? hs->toStr() : ""; } /*}}}*/ +void pkgAcquire::Item::FetchAfter(time_t FetchAfter) /*{{{*/ +{ + d->FetchAfter = FetchAfter; +} +time_t pkgAcquire::Item::FetchAfter() +{ + return d->FetchAfter; +} + /*}}}*/ bool pkgAcquire::Item::IsRedirectionLoop(std::string const &NewURI) /*{{{*/ { // store can fail due to permission errors and the item will "loop" then |