From 762da7d51b1571f4d7c1068a6f3e24cc045433d2 Mon Sep 17 00:00:00 2001 From: snltty <1069410172@qq.com> Date: Sun, 21 Jul 2024 16:36:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=AE=8C=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=85=B3=E9=97=AD=E7=A8=8B=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dotnet.yml | 3 ++- linker/plugins/updater/UpdaterClientTransfer.cs | 1 - linker/plugins/updater/UpdaterHelper.cs | 14 +++++--------- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 77ddeca3..9e733324 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -57,7 +57,8 @@ jobs: 2. 自动更新,客户端和服务端 3. 更多的消息提醒,需要重启时提醒 4. 脑抽 - 5. 请更新服务端 + 5. 更新完自动重启 + 6. 请更新服务端 - name: upload win x64 id: upload-win-x64 diff --git a/linker/plugins/updater/UpdaterClientTransfer.cs b/linker/plugins/updater/UpdaterClientTransfer.cs index cd7e86ac..36f1ae1f 100644 --- a/linker/plugins/updater/UpdaterClientTransfer.cs +++ b/linker/plugins/updater/UpdaterClientTransfer.cs @@ -2,7 +2,6 @@ using linker.config; using linker.plugins.client; using linker.plugins.messenger; -using linker.plugins.server; using linker.plugins.updater.messenger; using MemoryPack; using System.Collections.Concurrent; diff --git a/linker/plugins/updater/UpdaterHelper.cs b/linker/plugins/updater/UpdaterHelper.cs index a30164b3..aaa16e4a 100644 --- a/linker/plugins/updater/UpdaterHelper.cs +++ b/linker/plugins/updater/UpdaterHelper.cs @@ -46,8 +46,9 @@ namespace linker.plugins.updater updateInfo.Status = UpdateStatus.Checked; } - catch (Exception) + catch (Exception ex) { + LoggerHelper.Instance.Error(ex); updateInfo.Status = status; } } @@ -95,10 +96,7 @@ namespace linker.plugins.updater } catch (Exception ex) { - if (LoggerHelper.Instance.LoggerLevel <= LoggerTypes.DEBUG) - { - LoggerHelper.Instance.Error(ex); - } + LoggerHelper.Instance.Error(ex); try { File.Delete("updater.zip"); @@ -183,10 +181,7 @@ namespace linker.plugins.updater } catch (Exception ex) { - if (LoggerHelper.Instance.LoggerLevel <= LoggerTypes.DEBUG) - { - LoggerHelper.Instance.Error(ex); - } + LoggerHelper.Instance.Error(ex); updateInfo.Status = status; } } @@ -197,6 +192,7 @@ namespace linker.plugins.updater { await DownloadUpdate(updateInfo, version); await ExtractUpdate(updateInfo); + Environment.Exit(1); }); }