Skip to content

Commit

Permalink
其它异常也缓存
Browse files Browse the repository at this point in the history
  • Loading branch information
xljiulang committed Nov 24, 2021
1 parent b564731 commit aba0ea7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions FastGithub.DomainResolve/DnsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,12 @@ private async Task<IList<IPAddress>> LookupAsync(IPEndPoint dns, DnsEndPoint end
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
{
Expand Down

0 comments on commit aba0ea7

Please sign in to comment.