mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-08 01:33:34 +00:00
Merge pull request #2170 from zed-industries/fix-persistent-lsp-messages
Fix LSP status messages persisting
This commit is contained in:
commit
114eef8592
2 changed files with 10 additions and 2 deletions
|
@ -9,7 +9,7 @@ pub use isahc::{
|
|||
Error,
|
||||
};
|
||||
use smol::future::FutureExt;
|
||||
use std::sync::Arc;
|
||||
use std::{sync::Arc, time::Duration};
|
||||
pub use url::Url;
|
||||
|
||||
pub type Request = isahc::Request<AsyncBody>;
|
||||
|
@ -41,7 +41,13 @@ pub trait HttpClient: Send + Sync {
|
|||
}
|
||||
|
||||
pub fn client() -> Arc<dyn HttpClient> {
|
||||
Arc::new(isahc::HttpClient::builder().build().unwrap())
|
||||
Arc::new(
|
||||
isahc::HttpClient::builder()
|
||||
.connect_timeout(Duration::from_secs(5))
|
||||
.low_speed_timeout(100, Duration::from_secs(5))
|
||||
.build()
|
||||
.unwrap(),
|
||||
)
|
||||
}
|
||||
|
||||
impl HttpClient for isahc::HttpClient {
|
||||
|
|
|
@ -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