mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-06-01 18:52:27 +00:00
simplify check logic
This commit is contained in:
parent
ce6bc72b29
commit
f53863dbb6
|
@ -13,12 +13,10 @@ use structs::{DatabaseConnection, PictrsConfig, PictrsImageMode, Settings};
|
|||
static DEFAULT_CONFIG_FILE: &str = "config/config.hjson";
|
||||
|
||||
pub static SETTINGS: Lazy<Settings> = Lazy::new(|| {
|
||||
if let Ok(value) = env::var("LEMMY_INITIALIZE_WITH_DEFAULT_SETTINGS") {
|
||||
if value.eq("true") {
|
||||
println!("LEMMY_INITIALIZE_WITH_DEFAULT_SETTINGS was set to `true`, any configuration file has been ignored");
|
||||
println!("Use with other environment variables to configure this instance further, e.g. LEMMY_DATABASE_URL");
|
||||
return Settings::default();
|
||||
}
|
||||
if env::var("LEMMY_INITIALIZE_WITH_DEFAULT_SETTINGS").is_ok() {
|
||||
println!("LEMMY_INITIALIZE_WITH_DEFAULT_SETTINGS was set, any configuration file has been ignored");
|
||||
println!("Use with other environment variables to configure this instance further; e.g. LEMMY_DATABASE_URL");
|
||||
return Settings::default();
|
||||
}
|
||||
Settings::init().expect("Failed to load settings file, see documentation (https://join-lemmy.org/docs/en/administration/configuration.html)")
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue