修改Loopback IP缓存

This commit is contained in:
陈国伟 2021-08-19 13:13:53 +08:00
parent 7bf096ddb1
commit b69755a1b2

View File

@ -92,6 +92,12 @@ namespace FastGithub.DomainResolve
throw new FastGithubException($"当前解析不到{endPoint.Host}可用的ip请刷新重试");
}
// 往往是被污染的dns
if (address.Equals(IPAddress.Loopback) == false)
{
expiration = TimeSpan.FromSeconds(2d);
}
this.logger.LogInformation($"[{endPoint.Host}->{address}]");
this.memoryCache.Set(endPoint, address, expiration);
return address;