Skip to content

Commit

Permalink
change things around
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfv committed Mar 7, 2024
1 parent 67f7620 commit d0106e5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/install.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use crate::default_retry_policy;
use crate::progress::{
default_progress_style, finished_progress_style, global_multi_progress,
ProgressBarMessageFormatter,
};
use crate::utils::reqwest::default_retry_policy;
use futures::future::ready;
use futures::{stream, FutureExt, StreamExt, TryFutureExt, TryStreamExt};
use indicatif::ProgressBar;
Expand Down
8 changes: 0 additions & 8 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,3 @@ pub use task::{
CmdArgs, ExecutableTask, FindTaskError, FindTaskSource, RunOutput, SearchEnvironments, Task,
TaskDisambiguation, TaskExecutionError, TaskGraph, TaskGraphError,
};

use rattler_networking::retry_policies::ExponentialBackoff;

/// The default retry policy employed by pixi.
/// TODO: At some point we might want to make this configurable.
pub fn default_retry_policy() -> ExponentialBackoff {
ExponentialBackoff::builder().build_with_max_retries(3)
}
11 changes: 9 additions & 2 deletions src/utils/reqwest.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
use std::path::PathBuf;
use std::{sync::Arc, time::Duration};

use rattler_networking::AuthenticationMiddleware;
use rattler_networking::{MirrorMiddleware, OciMiddleware};
use rattler_networking::{
retry_policies::ExponentialBackoff, AuthenticationMiddleware, MirrorMiddleware, OciMiddleware,
};
use reqwest::Client;
use reqwest_middleware::{ClientBuilder, ClientWithMiddleware};

use crate::config::Config;

/// The default retry policy employed by pixi.
/// TODO: At some point we might want to make this configurable.
pub fn default_retry_policy() -> ExponentialBackoff {
ExponentialBackoff::builder().build_with_max_retries(3)
}

fn mirror_middleware() -> MirrorMiddleware {
let config = Config::from_path(&PathBuf::from("./config.toml")).expect("Failed to load config");
let mirror_map = config.mirror_map();
Expand Down

0 comments on commit d0106e5

Please sign in to comment.