mirror of
https://wget.la/https://github.com/leookun/cursor-byok
synced 2026-10-07 06:04:53 +08:00
fix: extend provider request timeout
This commit is contained in:
@@ -9,6 +9,7 @@ const DATA_DIR_NAME: &str = ".cursor-byok-v3";
|
|||||||
const DATABASE_FILE_NAME: &str = "cursor-byok.db";
|
const DATABASE_FILE_NAME: &str = "cursor-byok.db";
|
||||||
const V0049_DATA_DIR_NAME: &str = ".cursor-local-assistant-v2";
|
const V0049_DATA_DIR_NAME: &str = ".cursor-local-assistant-v2";
|
||||||
const V0049_CONFIG_FILE_NAME: &str = "config.yaml";
|
const V0049_CONFIG_FILE_NAME: &str = "config.yaml";
|
||||||
|
const DEFAULT_PROVIDER_REQUEST_TIMEOUT: Duration = Duration::from_secs(3000);
|
||||||
|
|
||||||
pub fn managed_data_dir() -> Result<PathBuf> {
|
pub fn managed_data_dir() -> Result<PathBuf> {
|
||||||
let home_dir = dirs::home_dir()
|
let home_dir = dirs::home_dir()
|
||||||
@@ -70,7 +71,7 @@ impl Config {
|
|||||||
Ok(value) => Duration::from_secs(value.parse().map_err(|error| {
|
Ok(value) => Duration::from_secs(value.parse().map_err(|error| {
|
||||||
Error::Config(format!("invalid CURSOR_PROVIDER_TIMEOUT_SECONDS: {error}"))
|
Error::Config(format!("invalid CURSOR_PROVIDER_TIMEOUT_SECONDS: {error}"))
|
||||||
})?),
|
})?),
|
||||||
Err(env::VarError::NotPresent) => Duration::from_secs(300),
|
Err(env::VarError::NotPresent) => DEFAULT_PROVIDER_REQUEST_TIMEOUT,
|
||||||
Err(error) => {
|
Err(error) => {
|
||||||
return Err(Error::Config(format!(
|
return Err(Error::Config(format!(
|
||||||
"invalid CURSOR_PROVIDER_TIMEOUT_SECONDS: {error}"
|
"invalid CURSOR_PROVIDER_TIMEOUT_SECONDS: {error}"
|
||||||
@@ -111,7 +112,7 @@ impl Config {
|
|||||||
.parse()
|
.parse()
|
||||||
.expect("desktop listen address is static"),
|
.expect("desktop listen address is static"),
|
||||||
database_url: default_database_url()?,
|
database_url: default_database_url()?,
|
||||||
provider_request_timeout: Duration::from_secs(300),
|
provider_request_timeout: DEFAULT_PROVIDER_REQUEST_TIMEOUT,
|
||||||
console: None,
|
console: None,
|
||||||
use_persisted_ports: true,
|
use_persisted_ports: true,
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user