From 519c4d8e8045f2028cbe02081b4fff95100766d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=9B=BD=E4=BC=9F?= <366193849@qq.com> Date: Tue, 15 Feb 2022 13:27:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=BC=82=E5=B8=B8=E6=8D=95?= =?UTF-8?q?=E8=8E=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FastGithub/AppHostedService.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/FastGithub/AppHostedService.cs b/FastGithub/AppHostedService.cs index 7cd58f0..39a9ee6 100644 --- a/FastGithub/AppHostedService.cs +++ b/FastGithub/AppHostedService.cs @@ -68,10 +68,17 @@ namespace FastGithub { if (OperatingSystem.IsWindows() == false) { - if (await this.UseFastGithubProxyAsync() == false) + try { - var httpProxyPort = this.fastGithubOptions.Value.HttpProxyPort; - this.logger.LogWarning($"请设置系统自动代理为http://{IPAddress.Loopback}:{httpProxyPort},或手动代理http/https为{IPAddress.Loopback}:{httpProxyPort}"); + if (await this.UseFastGithubProxyAsync() == false) + { + var httpProxyPort = this.fastGithubOptions.Value.HttpProxyPort; + this.logger.LogWarning($"请设置系统自动代理为http://{IPAddress.Loopback}:{httpProxyPort},或手动代理http/https为{IPAddress.Loopback}:{httpProxyPort}"); + } + } + catch (Exception) + { + this.logger.LogWarning("尝试获取代理信息失败"); } } }