feat: auto-fallback to Clash proxy on scheduled subscription updates; refactor fallback logic and add request timeout

This commit is contained in:
wonfen
2025-04-24 22:51:45 +08:00
parent 4d37e6870c
commit 8d62c0d521
8 changed files with 123 additions and 38 deletions

View File

@@ -60,6 +60,18 @@ const handleNoticeMessage = (
case "set_config::error":
Notice.error(msg);
break;
case "update_with_clash_proxy":
Notice.success(`${t("Update with Clash proxy successfully")} ${msg}`);
break;
case "update_retry_with_clash":
Notice.info(t("Update failed, retrying with Clash proxy..."));
break;
case "update_failed_even_with_clash":
Notice.error(`${t("Update failed even with Clash proxy")}: ${msg}`);
break;
case "update_failed":
Notice.error(msg);
break;
case "config_validate::boot_error":
Notice.error(`${t("Boot Config Validation Failed")} ${msg}`);
break;

View File

@@ -263,6 +263,8 @@ const ProfilePage = () => {
try {
await updateProfile(uid);
throttleMutate();
} catch (err: any) {
console.error(`更新订阅 ${uid} 失败:`, err);
} finally {
setLoadingCache((cache) => ({ ...cache, [uid]: false }));
}