From c7a7140d285c55bc77775209017b71445bb50ff4 Mon Sep 17 00:00:00 2001 From: LamGC Date: Wed, 19 Feb 2025 20:12:32 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E5=9C=A8=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E6=97=B6,=20=E5=8F=AA=E8=A6=81=20Xray-Core=20=E5=AD=98?= =?UTF-8?q?=E5=9C=A8,=20=E5=88=99=E5=85=81=E8=AE=B8=E6=A3=80=E6=9F=A5?= =?UTF-8?q?=E6=96=B0=E7=89=88=E6=9C=AC=E5=A4=B1=E8=B4=A5.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Proxd-man/XrayCoreManager.cs | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/Proxd-man/XrayCoreManager.cs b/Proxd-man/XrayCoreManager.cs index a708e61..49b8b15 100644 --- a/Proxd-man/XrayCoreManager.cs +++ b/Proxd-man/XrayCoreManager.cs @@ -260,12 +260,20 @@ public class XrayCoreManager( } else { - var latestXrayCoreVersion = await GetLatestXrayCoreVersion(); - if (currentVersion != latestXrayCoreVersion) + try { - requiredUpdate = true; - logger.LogInformation("发现新版本 Xray-Core (Version: {latestVersion}), 开始下载最新版本...", - latestXrayCoreVersion); + var latestXrayCoreVersion = await GetLatestXrayCoreVersion(); + if (currentVersion != latestXrayCoreVersion) + { + requiredUpdate = true; + logger.LogInformation("发现新版本 Xray-Core (Version: {latestVersion}), 开始下载最新版本...", + latestXrayCoreVersion); + } + } + catch (HttpRequestException e) + { + logger.LogError(e, "检查 Xray-Core 更新时发生错误, 跳过更新."); + return; } }