feat(profile): raise auto-update intervals below 24h

Each auto-update reloads the core, which drops every connection running through a
`proxy-providers` entry. Existing profiles are corrected once at startup; the form
warns about shorter intervals but still saves them.
This commit is contained in:
wonfen
2026-08-17 12:14:24 +08:00
parent 73d986369c
commit ec6241b30a
21 changed files with 215 additions and 17 deletions
+6
View File
@@ -21,6 +21,8 @@ pub static PORTABLE_FLAG: OnceCell<bool> = OnceCell::new();
pub static CLASH_CONFIG: &str = "config.yaml";
pub static VERGE_CONFIG: &str = "verge.yaml";
pub static PROFILE_YAML: &str = "profiles.yaml";
/// Marks that the one-shot raise of too-short auto-update intervals has already run.
pub static UPDATE_INTERVAL_MIGRATED: &str = ".update-interval-migrated";
/// init portable flag
pub fn init_portable_flag() -> Result<()> {
@@ -170,6 +172,10 @@ pub fn profiles_path() -> Result<PathBuf> {
Ok(app_home_dir()?.join(PROFILE_YAML))
}
pub fn update_interval_migrated_path() -> Result<PathBuf> {
Ok(app_home_dir()?.join(UPDATE_INTERVAL_MIGRATED))
}
#[cfg(target_os = "macos")]
pub fn service_path() -> Result<PathBuf> {
let res_dir = app_resources_dir()?;