From 9dfbaea1c5c1dbc329ed37046fd3965af2c17e09 Mon Sep 17 00:00:00 2001
From: xljiulang <366193849@qq.com>
Date: Thu, 15 Jul 2021 19:30:59 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=BB=98=E8=AE=A4=E9=85=8D?=
=?UTF-8?q?=E7=BD=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../{DnsHostedService.cs => DnsServerHostedService.cs} | 8 ++++----
FastGithub.Dns/DnsServiceCollectionExtensions.cs | 2 +-
FastGithub/appsettings.json | 4 ++--
3 files changed, 7 insertions(+), 7 deletions(-)
rename FastGithub.Dns/{DnsHostedService.cs => DnsServerHostedService.cs} (96%)
diff --git a/FastGithub.Dns/DnsHostedService.cs b/FastGithub.Dns/DnsServerHostedService.cs
similarity index 96%
rename from FastGithub.Dns/DnsHostedService.cs
rename to FastGithub.Dns/DnsServerHostedService.cs
index 05a8429..499eebc 100644
--- a/FastGithub.Dns/DnsHostedService.cs
+++ b/FastGithub.Dns/DnsServerHostedService.cs
@@ -14,13 +14,13 @@ namespace FastGithub.Dns
///
/// dns鍚庡彴鏈嶅姟
///
- sealed class DnsHostedService : BackgroundService
+ sealed class DnsServerHostedService : BackgroundService
{
private const int SIO_UDP_CONNRESET = unchecked((int)0x9800000C);
private readonly IRequestResolver requestResolver;
private readonly IOptions options;
- private readonly ILogger logger;
+ private readonly ILogger logger;
private readonly Socket socket = new(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
private readonly byte[] buffer = new byte[ushort.MaxValue];
@@ -33,10 +33,10 @@ namespace FastGithub.Dns
///
///
///
- public DnsHostedService(
+ public DnsServerHostedService(
GithubRequestResolver githubRequestResolver,
IOptions options,
- ILogger logger)
+ ILogger logger)
{
this.options = options;
this.logger = logger;
diff --git a/FastGithub.Dns/DnsServiceCollectionExtensions.cs b/FastGithub.Dns/DnsServiceCollectionExtensions.cs
index c36bfe6..715480f 100644
--- a/FastGithub.Dns/DnsServiceCollectionExtensions.cs
+++ b/FastGithub.Dns/DnsServiceCollectionExtensions.cs
@@ -20,7 +20,7 @@ namespace FastGithub
var assembly = typeof(DnsServiceCollectionExtensions).Assembly;
return services
.AddServiceAndOptions(assembly, configuration)
- .AddHostedService();
+ .AddHostedService();
}
}
}
diff --git a/FastGithub/appsettings.json b/FastGithub/appsettings.json
index 30c7b58..e1d67a0 100644
--- a/FastGithub/appsettings.json
+++ b/FastGithub/appsettings.json
@@ -1,7 +1,7 @@
{
"Dns": {
"UpStream": "114.114.114.114", // 上游dns
- "GithubTTL": "00:10:00", // github相关域名解析结果的存活时长
+ "GithubTTL": "00:05:00", // github相关域名解析结果的存活时长
"SetToLocalMachine": true, // 是否设置本机使用此dns(仅支持windows)
"UseGithubReverseProxy": true // 是否使用反向代理访问github以解决连接被重复的问题
},
@@ -15,7 +15,7 @@
},
"PublicDnsProvider": {
"Enable": true, // 是否需要从dns服务器查找ip
- "Timeout": "00:00:00.100", // dns查询超时时长
+ "Timeout": "00:00:00.200", // dns查询超时时长
"Dnss": [ // dns服务器列表
"1.2.4.8",
"8.8.8.8",