refactor(profile): look up the refresh target once

This commit is contained in:
Tunglies
2026-12-03 19:38:18 +08:00
parent c53e005f25
commit c742a9a17c
3 changed files with 30 additions and 46 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
use crate::{
config::{Config, PrfOption, download_subscription, prepare_remote_refresh, profiles::apply_remote_refresh_safe},
config::{Config, PrfOption, download_subscription, prepare_remote_refresh, profiles::save_remote_refresh},
core::{
CoreManager, handle,
notify::{NoticeStatus, Refresh, announce},
@@ -133,7 +133,7 @@ async fn perform_profile_update(
"profile source changed during refresh"
);
let refresh = prepare_remote_refresh(downloaded, merged_opt.as_ref()).await?;
apply_remote_refresh_safe(uid, url, refresh).await?;
save_remote_refresh(uid, url, refresh).await?;
if !matches!(strategy, Strategy::Configured) {
handle::Handle::notice(NoticeStatus::UpdateWithClashProxy, profile_name.as_str());
}