Skip to content

Commit

Permalink
Adjusted the code bsaed upon review
Browse files Browse the repository at this point in the history
Signed-off-by: BlackDex <black.dex@gmail.com>
  • Loading branch information
BlackDex committed Oct 11, 2024
1 parent ad70e59 commit 115ccb8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ static CONFIG_FILE: Lazy<String> = Lazy::new(|| {
get_env("CONFIG_FILE").unwrap_or_else(|| format!("{data_folder}/config.json"))
});

pub static SKIP_CONFIG_VALIDATION: Lazy<AtomicBool> = Lazy::new(|| AtomicBool::new(false));
pub static SKIP_CONFIG_VALIDATION: AtomicBool = AtomicBool::new(false);

pub static CONFIG: Lazy<Config> = Lazy::new(|| {
Config::load().unwrap_or_else(|e| {
Expand Down Expand Up @@ -1110,7 +1110,7 @@ impl Config {

// Fill any missing with defaults
let config = builder.build();
if !SKIP_CONFIG_VALIDATION.load(Ordering::SeqCst) {
if !SKIP_CONFIG_VALIDATION.load(Ordering::Relaxed) {
validate_config(&config)?;
}

Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ fn parse_args() {
print!("{HELP}");
exit(0);
} else if pargs.contains(["-v", "--version"]) {
config::SKIP_CONFIG_VALIDATION.store(true, Ordering::SeqCst);
config::SKIP_CONFIG_VALIDATION.store(true, Ordering::Relaxed);
let web_vault_version = util::get_web_vault_version();
println!("Vaultwarden {version}");
println!("Web-Vault {web_vault_version}");
Expand Down

0 comments on commit 115ccb8

Please sign in to comment.