Skip to content

Commit

Permalink
fix(cli): deadlock regression from #7802 (#7948)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog committed Oct 3, 2023
1 parent b597aa5 commit d735324
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
5 changes: 3 additions & 2 deletions tooling/cli/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions tooling/cli/src/helpers/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,13 @@ pub fn get(target: Target, merge_config: Option<&str>) -> crate::Result<ConfigHa
}

pub fn reload(merge_config: Option<&str>) -> crate::Result<ConfigHandle> {
if let Some(conf) = &*config_handle().lock().unwrap() {
get_internal(merge_config, true, conf.target)
let target = config_handle()
.lock()
.unwrap()
.as_ref()
.map(|conf| conf.target);
if let Some(target) = target {
get_internal(merge_config, true, target)
} else {
Err(anyhow::anyhow!("config not loaded"))
}
Expand Down

0 comments on commit d735324

Please sign in to comment.