summaryrefslogtreecommitdiff
path: root/crates/tor-dirmgr/src/retry.rs
Commit message (Collapse)AuthorAgeFilesLines
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-071-2/+2
| | | | | | | | | | | | | | First, run ``` git grep -l "^edition =" | xargs perl -i -pe 's/^edition *=.*/edition = "2024"/;' ``` Second, manually verify that all Cargo.toml files have changed, and nothing else has changed. Third, run cargo fmt again.
* Update code for Edition 2024Nick Mathewson2025-08-071-1/+1
| | | | | | | | | | | | | | | | | | 1. Run cargo fix --edition 2. Selectively revert the "if let"->"match" changes. These changes are meant to protect us from the lifetime changes for "if let" bindings in Rust 2024. But we're not actually relying on the old lifetime rules anywhere, and the match syntax here is quite ugly. 3. Automatically revert `$pat:expr_2021` to `$pat:expr`. (We don't actually want to restrict the expression syntax that our macros accept). Done with `git grep -l expr_2021 | xargs perl -i -pe 's/expr_2021/expr/g;'` 4. Run cargo fmt.
* config-path, dirmgr, general-addr: Remove unnecessary parentheses (fmt).Gabriela Moldovan2025-07-151-2/+1
|
* config-path, dirmgr, general-addr: Remove unnecessary parentheses.Gabriela Moldovan2025-07-151-1/+1
| | | | This resolves some nightly clippy warnings.
* Run maint/add_warning.Nick Mathewson2024-03-131-0/+1
|
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-231-0/+1
|
* Resolve warnings about ambiguous/redundant doc linksNick Mathewson2023-08-221-1/+1
| | | | | Nightly rustdoc now warns if you have a link that isn't necessary, and if you have a link that might refer to two different things.
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-101-0/+1
|
* Allow clippy::unchecked_duration_subtraction in testsNick Mathewson2023-01-271-0/+1
| | | | | This panics on error, and we're fine with a panic on misbehavior in tests.
* test lint blocks: Add many many automaticallyIan Jackson2022-12-121-0/+9
| | | | | This is precisely the result of running the rune in maint/adhoc-add-lint-blocks.
* impl_standard_builder: Use for tor_dirmgr::DownloadScheduleIan Jackson2022-06-161-14/+3
|
* Add some missing `serde(default)` to uses of humantime_serde::optionIan Jackson2022-06-161-1/+1
| | | | | Without this, if the substructure is provided, these fields are mandatory within it.
* Use testing_rng() in tests throughout our crates.Nick Mathewson2022-06-021-1/+2
| | | | | | This only affects uses of thread_rng(), and affects them all more or less indiscriminately. One test does not work with ARTI_TEST_PRNG=deterministic; the next commit will fix it.
* config derive attrs: Make builders serde, and validated structs notIan Jackson2022-05-051-12/+3
| | | | | | | | | | | | | | | * Builders additionally derive: Debug, Serialize, Deserialize. * Validated structs no longer derive: Serialize, Deserialize and all related attributes deleted. * As a consequence, all the `#[serde(deny_unknown_fields)]` are gone. That means that right now unknown fields are totally ignored. This is good for compatibility but poor for useability. Doing something better here is arti#417, in progress. * As a consequence, delete tor_dirmgr::retry::default_parallelism. (The default value was already duplicated into a builder attr.)
* Merge branch 'download-schedule' into 'main'Nick Mathewson2022-04-261-38/+77
|\ | | | | | | | | DownloadSchedule: Introduce Builder See merge request tpo/core/arti!473
| * Make DownloadScheduleBuilder "alternative" defaults pub(crate)Ian Jackson2022-04-261-2/+2
| | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/473#note_2798464
| * Fix typo in messageNick Mathewson2022-04-261-1/+1
| |
| * DownloadSchedule: Rename field to "attempts"Ian Jackson2022-04-261-8/+8
| | | | | | | | | | | | | | This is actually a number of *attempts* not a number of *retries*. The setter method was already called "attempts". This chnages the deserialisation of the config.
| * DownloadSchudule: Have NetworkConfig contain BuildersIan Jackson2022-04-261-0/+21
| | | | | | | | | | | | | | | | | | | | | | Use sub_builder. We must do something special for defaults. This involves moving the actual default values for retry_bootstrap and retry_microdescs into config.rs, since they need to access the fields of the un-built version of the structure. (An alternative would be to generate "weak setters" which do not override previous settings, but derive_builder does not offer to generate them and that seems overkill.)
| * DownloadSchedule: Abolish new() methodIan Jackson2022-04-261-24/+3
| | | | | | | | | | | | | | | | | | | | Instead, everyone should use DownloadScheduleBuilder. The new() method would in any case be useless in a moment, since we're going to embed DownloadScheduleBuilder in the NetworkConfig, not DownloadSchedule. The call sites in the tests are all about to change again.
| * DownloadSchedule: tests: Do not try to set parallelism to 0Ian Jackson2022-04-261-11/+9
| | | | | | | | | | | | | | | | The current behaviour is to treat 0 as indicating "use the default", which is quite strange. We are going to get rid of that. The new way will be to reject zero, during DownloadScheduleBuilder::build, Add a test case for that.
| * DownloadSchedule: Provide builderIan Jackson2022-04-261-1/+42
| |
* | squash! Bump every crate's edition to 2021.Nick Mathewson2022-04-251-1/+0
|/ | | | | Remove all `use` statements for `TryFrom` and `TryInto`. These are now redundant in Rust 2021.
* RetryDelay: remove accessors.Nick Mathewson2022-03-161-7/+9
| | | | Instead, check initial_delay in dirmgr directly.
* Remove re-export of retry-schedule in tor-dirmgr.Nick Mathewson2022-03-161-1/+1
| | | | It wasn't necessary.
* Fix up documentation on RetryDelay.Nick Mathewson2022-03-161-6/+3
| | | | | It's no longer about downloads; it's about whatever you need to retry.
* Move RetryDelay from dirmgr to basic-utils.Nick Mathewson2022-03-161-155/+1
| | | | | This (almost) a pure code-movement commit: it also makes one public function private in order to suppress a warning.
* RetryDelay: add accessors for stateNick Mathewson2022-03-161-5/+22
| | | | | We'll need these for our unit tests in tor-dirmgr once we move RetryDelay into tor-basic-utils.
* Add basic tests for high-level buildersNick Mathewson2021-11-251-0/+1
| | | | | Make sure that we can change elements, and we can reconstruct builders that give us the same thing.
* Rename RetryConfig to DownloadSchedule, fold in parallelism.Nick Mathewson2021-11-181-16/+41
|
* More tests on tor-dirmgr::stateNick Mathewson2021-11-081-1/+1
| | | | | These test our download schedules, resetting to the original state, and storing downloaded objects.
* Move all crates into a `crates` subdirectory.Nick Mathewson2021-08-271-0/+237
This will cause some pain for now, but now is really the best time to do this kind of thing.