Make dotenv file optional

This commit is contained in:
Tom Bloor 2024-04-21 23:43:40 +01:00
parent c194daa42c
commit 28d5fd71fb
Signed by: TBSliver
GPG key ID: 4657C7EBE42CC5CC

View file

@ -53,7 +53,7 @@ pub struct Config {
impl Config {
pub fn from_env() -> Result<Self, Box<dyn Error>> {
dotenvy::dotenv()?;
dotenvy::dotenv().ok();
let redis_url = std::env::var("REDIS_URL").unwrap_or("redis://127.0.0.1/".to_string());
let redis_cache_time: i64 = std::env::var("REDIS_CACHE_TIME")