diff --git a/ohkami/src/config.rs b/ohkami/src/config.rs index 2cbfe3c73..98cd1bbeb 100644 --- a/ohkami/src/config.rs +++ b/ohkami/src/config.rs @@ -25,14 +25,18 @@ impl Config { Self { #[cfg(feature="__rt_native__")] keepalive_timeout: std::sync::LazyLock::new(|| std::env::var("OHKAMI_KEEPALIVE_TIMEOUT") - .ok().map(|v| v.parse().ok()).flatten() - .unwrap_or(42) + .ok() + .map(|v| v.parse().ok()) + .flatten() + .unwrap_or(30) // 30 seconds ), #[cfg(feature="__rt_native__")] #[cfg(feature="ws")] websocket_timeout: std::sync::LazyLock::new(|| std::env::var("OHKAMI_WEBSOCKET_TIMEOUT") - .ok().map(|v| v.parse().ok()).flatten() - .unwrap_or(42) + .ok() + .map(|v| v.parse().ok()) + .flatten() + .unwrap_or(1 * 60 * 60) // 1 hour ), } } diff --git a/ohkami/src/session/mod.rs b/ohkami/src/session/mod.rs index 164ee70b8..d43e3734e 100644 --- a/ohkami/src/session/mod.rs +++ b/ohkami/src/session/mod.rs @@ -80,7 +80,7 @@ impl Session { }).await { None => crate::warning!("[WARNING] \ Session timeouted. In Ohkami, Keep-Alive timeout \ - is set to 42 seconds by default and is configurable \ + is set to 30 seconds by default and is configurable \ by `OHKAMI_KEEPALIVE_TIMEOUT` environment variable.\ "),