Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Add a 5s timeout when running `npm info` and `npm install`

Antonio Scandurra2c1fd7b0bf63
diff --git a/crates/zed/src/languages/installation.rs b/crates/zed/src/languages/installation.rs
index 40edbb88d74..c5aff17e566 100644
--- a/crates/zed/src/languages/installation.rs
+++ b/crates/zed/src/languages/installation.rs
@@ -37,6 +37,8 @@ pub(crate) struct GithubReleaseAsset {
pub async fn npm_package_latest_version(name: &str) -> Result<String> {
let output = smol::process::Command::new("npm")
+ .args(["-fetch-retry-mintimeout", "2000"])
+ .args(["-fetch-retry-maxtimeout", "5000"])
.args(["info", name, "--json"])
.output()
.await
@@ -60,6 +62,8 @@ pub async fn npm_install_packages(
directory: &Path,
) -> Result<()> {
let output = smol::process::Command::new("npm")
+ .args(["-fetch-retry-mintimeout", "2000"])
+ .args(["-fetch-retry-maxtimeout", "5000"])
.arg("install")
.arg("--prefix")
.arg(directory)