From 889de3185ce82cf7905ce1679b2fbf3afee57e54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=9B=BD=E4=BC=9F?= <366193849@qq.com> Date: Wed, 29 Sep 2021 15:17:36 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4DNS=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E7=AD=89=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FastGithub.DomainResolve/DnsClient.cs | 5 +++++ FastGithub/appsettings.json | 1 + 2 files changed, 6 insertions(+) diff --git a/FastGithub.DomainResolve/DnsClient.cs b/FastGithub.DomainResolve/DnsClient.cs index e97867b..f2721b4 100644 --- a/FastGithub.DomainResolve/DnsClient.cs +++ b/FastGithub.DomainResolve/DnsClient.cs @@ -188,6 +188,11 @@ namespace FastGithub.DomainResolve return result.Addresses; } + catch (OperationCanceledException) + { + this.logger.LogInformation($"dns://{dns}无法解析{domain}:请求超时"); + return Array.Empty(); + } catch (Exception ex) { this.logger.LogWarning($"dns://{dns}无法解析{domain}:{ex.Message}"); diff --git a/FastGithub/appsettings.json b/FastGithub/appsettings.json index b157b18..f7907bc 100644 --- a/FastGithub/appsettings.json +++ b/FastGithub/appsettings.json @@ -29,6 +29,7 @@ "Yarp": "Warning", "System": "Warning", "Microsoft": "Warning", + "FastGithub.DomainResolve": "Warning", "Microsoft.AspNetCore.Server.Kestrel": "Error" } }