Skip to content

Commit

Permalink
fix: download keeps failing if it takes more than 30s
Browse files Browse the repository at this point in the history
  • Loading branch information
roele committed May 30, 2024
1 parent 402c5ce commit f78d680
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ pub static ARGV0: Lazy<String> = Lazy::new(|| ARGS.read().unwrap()[0].to_string(
pub static MISE_BIN_NAME: Lazy<&str> = Lazy::new(|| filename(&ARGV0));
pub static MISE_LOG_FILE: Lazy<Option<PathBuf>> = Lazy::new(|| var_path("MISE_LOG_FILE"));
pub static MISE_LOG_FILE_LEVEL: Lazy<Option<LevelFilter>> = Lazy::new(log_file_level);
pub static MISE_HTTP_REQUEST_TIMEOUT: Lazy<Duration> =
Lazy::new(|| var_duration("MISE_HTTP_REQUEST_TIMEOUT").unwrap_or(Duration::from_secs(30)));
pub static MISE_FETCH_REMOTE_VERSIONS_TIMEOUT: Lazy<Duration> = Lazy::new(|| {
var_duration("MISE_FETCH_REMOTE_VERSIONS_TIMEOUT").unwrap_or(Duration::from_secs(10))
});
Expand Down
4 changes: 2 additions & 2 deletions src/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use tokio::runtime::Runtime;
use url::Url;

use crate::cli::version;
use crate::env::MISE_FETCH_REMOTE_VERSIONS_TIMEOUT;
use crate::env::{MISE_FETCH_REMOTE_VERSIONS_TIMEOUT, MISE_HTTP_REQUEST_TIMEOUT};
use crate::file::display_path;
use crate::ui::progress_report::SingleReport;
use crate::{env, file};
Expand All @@ -19,7 +19,7 @@ use crate::{env, file};
pub static HTTP_VERSION_CHECK: Lazy<Client> =
Lazy::new(|| Client::new(Duration::from_secs(3)).unwrap());

pub static HTTP: Lazy<Client> = Lazy::new(|| Client::new(Duration::from_secs(30)).unwrap());
pub static HTTP: Lazy<Client> = Lazy::new(|| Client::new(*MISE_HTTP_REQUEST_TIMEOUT).unwrap());

pub static HTTP_FETCH: Lazy<Client> =
Lazy::new(|| Client::new(*MISE_FETCH_REMOTE_VERSIONS_TIMEOUT).unwrap());
Expand Down

0 comments on commit f78d680

Please sign in to comment.