Selaa lähdekoodia

其它异常也缓存

陈国伟 3 vuotta sitten
vanhempi
commit
aba0ea7c2f
1 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. 2 2
      FastGithub.DomainResolve/DnsClient.cs

+ 2 - 2
FastGithub.DomainResolve/DnsClient.cs

@@ -133,12 +133,12 @@ namespace FastGithub.DomainResolve
             catch (SocketException ex)
             {
                 this.logger.LogWarning($"{endPoint.Host}@{dns}:{ex.Message}");
-                return this.dnsCache.Set(key, Array.Empty<IPAddress>(), this.maxTimeToLive);
+                return this.dnsCache.Set(key, Array.Empty<IPAddress>(), this.minTimeToLive);
             }
             catch (Exception ex)
             {
                 this.logger.LogWarning($"{endPoint.Host}@{dns}:{ex.Message}");
-                return Array.Empty<IPAddress>();
+                return this.dnsCache.Set(key, Array.Empty<IPAddress>(), this.minTimeToLive);
             }
             finally
             {