Skip to content

Commit

Permalink
fix(Binaries): Do not clear REQUIRES map to avoid deadlock
Browse files Browse the repository at this point in the history
  • Loading branch information
nokome committed Aug 31, 2021
1 parent 6cd52a9 commit d317c08
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions rust/src/binaries.rs
Expand Up @@ -168,14 +168,6 @@ impl Binary {
None
}

/// Clear any cached requires of this binary
async fn clear(&self) {
REQUIRES
.lock()
.await
.retain(|_, installation| installation.name != self.name);
}

/// Resolve the path and version of a binary
pub fn resolve(&mut self) {
// Collect the directories for previously installed versions
Expand Down Expand Up @@ -315,8 +307,7 @@ impl Binary {
)
}

// Always clear any cached requires and re-resolve after an install
self.clear().await;
// Always re-resolve after an install
self.resolve();

Ok(())
Expand Down Expand Up @@ -601,8 +592,7 @@ impl Binary {
tracing::warn!("No matching Stencila installed binary found")
}

// Always clear cached requires and re-resolve after an uninstall
self.clear().await;
// Always re-resolve after an uninstall
self.resolve();

Ok(())
Expand Down

0 comments on commit d317c08

Please sign in to comment.