Skip to content

Commit

Permalink
docs & features
Browse files Browse the repository at this point in the history
  • Loading branch information
haxjump committed Oct 26, 2024
1 parent 5120d90 commit bd878fd
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ruc"
version = "7.7.1"
version = "7.7.3"
authors = ["[email protected]"]
edition = "2021"
description = "Rust Util Collections"
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ Links to static documentations:
- `$RUC_SSH_TIMEOUT`: ssh process timeout
- Default to 20s
- The max value is 300s(5 minutes)
- `$RUC_HTTP_TIMEOUT`: http process timeout
- Default to 3s
- The max value is 255s(`u8::MAX`)

### Gratitude

Expand Down
7 changes: 4 additions & 3 deletions src/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ use reqwest::{
use std::{env, sync::LazyLock, time::Duration};

static TIME_OUT: LazyLock<Duration> = LazyLock::new(|| {
let default = 3;
let secs = if let Ok(t) = env::var("RUC_HTTP_TIMEOUT") {
pnk!(t.parse::<u64>())
t.parse::<u8>().unwrap_or(default)
} else {
3
default
};
Duration::from_secs(secs)
Duration::from_secs(secs as u64)
});

pub fn get(
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ pub mod uau;
#[cfg(feature = "http")]
pub mod http;

// DO NOT SET features!
pub mod algo;

// DO NOT SET features!
pub mod ende;

/////////////////////////////////////////////
Expand Down

0 comments on commit bd878fd

Please sign in to comment.