fix: remove auto clean up profiles behavior in resolve process

This commit is contained in:
Tunglies
2025-08-28 04:38:10 +08:00
parent 51ff9e1851
commit d23d1d9a1d
4 changed files with 4 additions and 35 deletions

View File

@@ -18,6 +18,10 @@
- 修复任务管理中的潜在并发问题 - 修复任务管理中的潜在并发问题
- 修复通过托盘重启应用无法恢复 - 修复通过托盘重启应用无法恢复
### 🗑️ 移除内容
- 移除启动阶段自动清理过期订阅
## v2.4.0 ## v2.4.0
**发行代号:融** **发行代号:融**

View File

@@ -253,10 +253,6 @@ pub async fn delete_profile(index: String) -> CmdResult {
// 使用Send-safe helper函数 // 使用Send-safe helper函数
let should_update = wrap_err!(profiles_delete_item_safe(index).await)?; let should_update = wrap_err!(profiles_delete_item_safe(index).await)?;
// 删除后自动清理冗余文件
let profiles = Config::profiles().await;
let _ = profiles.latest_ref().auto_cleanup();
if should_update { if should_update {
match CoreManager::global().update_config().await { match CoreManager::global().update_config().await {
Ok(_) => { Ok(_) => {

View File

@@ -735,25 +735,6 @@ impl IProfiles {
.unwrap_or(false) .unwrap_or(false)
}) })
} }
pub fn auto_cleanup(&self) -> Result<()> {
match self.cleanup_orphaned_files() {
Ok(result) => {
if !result.deleted_files.is_empty() {
log::info!(
target: "app",
"自动清理完成,删除了 {} 个冗余文件",
result.deleted_files.len()
);
}
Ok(())
}
Err(e) => {
log::warn!(target: "app", "自动清理失败: {e}");
Ok(())
}
}
}
} }
// 特殊的Send-safe helper函数完全避免跨await持有guard // 特殊的Send-safe helper函数完全避免跨await持有guard

View File

@@ -138,18 +138,6 @@ pub async fn resolve_setup_async(app_handle: &AppHandle) {
logging_error!(Type::Config, true, Config::init_config().await); logging_error!(Type::Config, true, Config::init_config().await);
logging!(info, Type::Config, true, "配置初始化完成"); logging!(info, Type::Config, true, "配置初始化完成");
// 启动时清理冗余的 Profile 文件
logging!(info, Type::Setup, true, "开始清理冗余的Profile文件...");
match Config::profiles().await.latest_ref().auto_cleanup() {
Ok(_) => {
logging!(info, Type::Setup, true, "启动时Profile文件清理完成");
}
Err(e) => {
logging!(warn, Type::Setup, true, "启动时清理Profile文件失败: {}", e);
}
}
logging!(trace, Type::Core, true, "启动核心管理器..."); logging!(trace, Type::Core, true, "启动核心管理器...");
logging_error!(Type::Core, true, CoreManager::global().init().await); logging_error!(Type::Core, true, CoreManager::global().init().await);