修改HttpClient存活时间
This commit is contained in:
parent
d3b890728f
commit
3004842a18
@ -88,13 +88,17 @@ namespace FastGithub.Scanner
|
|||||||
{
|
{
|
||||||
this.logger.LogInformation("结果扫描开始..");
|
this.logger.LogInformation("结果扫描开始..");
|
||||||
|
|
||||||
var contexts = this.scanResults.ToArray();
|
var results = this.scanResults.ToArray();
|
||||||
|
var contexts = results
|
||||||
|
.OrderByDescending(item => item.History.AvailableRate)
|
||||||
|
.ThenBy(item => item.History.AvgElapsed);
|
||||||
|
|
||||||
foreach (var context in contexts)
|
foreach (var context in contexts)
|
||||||
{
|
{
|
||||||
await this.resultScanDelegate(context);
|
await this.resultScanDelegate(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.logger.LogInformation($"结果扫描结束,共扫描{contexts.Length}条记录");
|
this.logger.LogInformation($"结果扫描结束,共扫描{results.Length}条记录");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,7 +25,7 @@ namespace FastGithub
|
|||||||
|
|
||||||
services
|
services
|
||||||
.AddHttpClient(nameof(FastGithub))
|
.AddHttpClient(nameof(FastGithub))
|
||||||
.SetHandlerLifetime(TimeSpan.FromMinutes(10d))
|
.SetHandlerLifetime(TimeSpan.FromMinutes(5d))
|
||||||
.ConfigureHttpClient(httpClient =>
|
.ConfigureHttpClient(httpClient =>
|
||||||
{
|
{
|
||||||
httpClient.DefaultRequestHeaders.Accept.TryParseAdd("*/*");
|
httpClient.DefaultRequestHeaders.Accept.TryParseAdd("*/*");
|
||||||
|
|||||||
@ -4,9 +4,10 @@
|
|||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<TargetFrameworks>net5.0;net6.0</TargetFrameworks>
|
<TargetFrameworks>net5.0;net6.0</TargetFrameworks>
|
||||||
<Version>1.0.0-beta3</Version>
|
<Version>1.0.0-beta4</Version>
|
||||||
<Description>github定制版的dns服务,解析github最优的ip</Description>
|
<Description>github定制版的dns服务,解析github最优的ip</Description>
|
||||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||||
|
<Copyright>https://github.com/xljiulang/FastGithub</Copyright>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(TargetFramework)' == 'net6.0'">
|
<PropertyGroup Condition="'$(TargetFramework)' == 'net6.0'">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user