From efb59f253508c187f98268e74d697bb3e3d19119 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, 28 Sep 2021 17:32:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9dns=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FastGithub.DomainResolve/DnsClient.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/FastGithub.DomainResolve/DnsClient.cs b/FastGithub.DomainResolve/DnsClient.cs index fcbd061..06116b8 100644 --- a/FastGithub.DomainResolve/DnsClient.cs +++ b/FastGithub.DomainResolve/DnsClient.cs @@ -31,7 +31,7 @@ namespace FastGithub.DomainResolve private readonly ConcurrentDictionary semaphoreSlims = new(); private readonly IMemoryCache dnsCache = new MemoryCache(Options.Create(new MemoryCacheOptions())); - private readonly TimeSpan dnsExpiration = TimeSpan.FromMinutes(2d); + private readonly TimeSpan dnsExpiration = TimeSpan.FromMinutes(1d); private readonly int resolveTimeout = (int)TimeSpan.FromSeconds(2d).TotalMilliseconds; /// @@ -108,6 +108,9 @@ namespace FastGithub.DomainResolve { value = await this.LookupCoreAsync(dns, domain, cancellationToken); this.dnsCache.Set(key, value, this.dnsExpiration); + + var items = string.Join(", ", value.Select(item => item.ToString())); + this.logger.LogInformation($"dns://{dns}:{domain}->[{items}]"); } return value; }