fix recovery

This commit is contained in:
Aiden McClelland
2021-10-08 11:22:24 -06:00
committed by Aiden McClelland
parent c199a6525f
commit b2fa955ad5
3 changed files with 102 additions and 33 deletions

View File

@@ -124,7 +124,12 @@ impl SetupContext {
}
pub async fn product_key(&self) -> Result<Arc<String>, Error> {
Ok(
if let Some(k) = { self.cached_product_key.read().await.clone() } {
if let Some(k) = {
let guard = self.cached_product_key.read().await;
let res = guard.clone();
drop(guard);
res
} {
k
} else {
let k = Arc::new(get_product_key().await?);