cryptDns重试请求
This commit is contained in:
parent
930a8b624a
commit
b6348133e4
@ -46,11 +46,10 @@ namespace FastGithub.DomainResolve
|
|||||||
{
|
{
|
||||||
var key = $"{dns}:{domain}";
|
var key = $"{dns}:{domain}";
|
||||||
var semaphore = this.semaphoreSlims.GetOrAdd(key, _ => new SemaphoreSlim(1, 1));
|
var semaphore = this.semaphoreSlims.GetOrAdd(key, _ => new SemaphoreSlim(1, 1));
|
||||||
|
await semaphore.WaitAsync(CancellationToken.None);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await semaphore.WaitAsync(CancellationToken.None);
|
|
||||||
|
|
||||||
if (this.dnsCache.TryGetValue<IPAddress[]>(key, out var value) == false)
|
if (this.dnsCache.TryGetValue<IPAddress[]>(key, out var value) == false)
|
||||||
{
|
{
|
||||||
value = await this.LookupCoreAsync(dns, domain, cancellationToken);
|
value = await this.LookupCoreAsync(dns, domain, cancellationToken);
|
||||||
|
|||||||
@ -78,6 +78,7 @@ namespace FastGithub.DomainResolve
|
|||||||
if (cryptDns != null)
|
if (cryptDns != null)
|
||||||
{
|
{
|
||||||
yield return cryptDns;
|
yield return cryptDns;
|
||||||
|
yield return cryptDns;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var fallbackDns in this.fastGithubConfig.FallbackDns)
|
foreach (var fallbackDns in this.fastGithubConfig.FallbackDns)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user