mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-08 01:33:34 +00:00
Add timeout to HTTP requests during npm info
and npm fetch
This commit is contained in:
parent
7641965326
commit
2482a1a9ce
1 changed files with 2 additions and 0 deletions
|
@ -39,6 +39,7 @@ 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(["-fetch-timeout", "5000"])
|
||||
.args(["info", name, "--json"])
|
||||
.output()
|
||||
.await
|
||||
|
@ -64,6 +65,7 @@ pub async fn npm_install_packages(
|
|||
let output = smol::process::Command::new("npm")
|
||||
.args(["-fetch-retry-mintimeout", "2000"])
|
||||
.args(["-fetch-retry-maxtimeout", "5000"])
|
||||
.args(["-fetch-timeout", "5000"])
|
||||
.arg("install")
|
||||
.arg("--prefix")
|
||||
.arg(directory)
|
||||
|
|
Loading…
Reference in a new issue