From 3e2bcacc083b455a8dfa1cf85fcfee06d9811dd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=81=E4=B9=9D?= <366193849@qq.com> Date: Sat, 28 Aug 2021 00:55:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9timeout=E4=B8=8E=E6=97=A5?= =?UTF-8?q?=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FastGithub.DomainResolve/DomainResolver.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/FastGithub.DomainResolve/DomainResolver.cs b/FastGithub.DomainResolve/DomainResolver.cs index 3be0885..021e4a1 100644 --- a/FastGithub.DomainResolve/DomainResolver.cs +++ b/FastGithub.DomainResolve/DomainResolver.cs @@ -28,7 +28,7 @@ namespace FastGithub.DomainResolve private readonly ILogger logger; private readonly TimeSpan lookupTimeout = TimeSpan.FromSeconds(5d); - private readonly TimeSpan connectTimeout = TimeSpan.FromSeconds(2d); + private readonly TimeSpan connectTimeout = TimeSpan.FromSeconds(5d); private readonly TimeSpan dnscryptExpiration = TimeSpan.FromMinutes(5d); private readonly TimeSpan fallbackExpiration = TimeSpan.FromMinutes(1d); private readonly TimeSpan loopbackExpiration = TimeSpan.FromSeconds(5d); @@ -226,12 +226,12 @@ namespace FastGithub.DomainResolve } catch (OperationCanceledException) { - this.logger.LogWarning($"已跳过连接过慢IP:{address}"); + this.logger.LogWarning($"已忽略连接超时的IP:{address}"); return default; } catch (Exception) { - this.logger.LogWarning($"已跳过不可连接的IP:{address}"); + this.logger.LogWarning($"已忽略不可连接的IP:{address}"); await Task.Delay(this.connectTimeout, cancellationToken); return default; }