ph负载均衡模式
This commit is contained in:
parent
dd36207241
commit
6af2e01c09
@ -79,7 +79,8 @@ namespace FastGithub.DomainResolve
|
|||||||
var localEndPoint = new IPEndPoint(IPAddress.Loopback, port);
|
var localEndPoint = new IPEndPoint(IPAddress.Loopback, port);
|
||||||
|
|
||||||
await TomlUtil.SetListensAsync(this.tomlFilePath, localEndPoint, cancellationToken);
|
await TomlUtil.SetListensAsync(this.tomlFilePath, localEndPoint, cancellationToken);
|
||||||
await TomlUtil.SetlogLevelAsync(this.tomlFilePath, 6, cancellationToken);
|
await TomlUtil.SetLogLevelAsync(this.tomlFilePath, 6, cancellationToken);
|
||||||
|
await TomlUtil.SetLBStrategyAsync(this.tomlFilePath, "ph", cancellationToken);
|
||||||
await TomlUtil.SetMinMaxTTLAsync(this.tomlFilePath, TimeSpan.FromMinutes(1d), TimeSpan.FromMinutes(2d), cancellationToken);
|
await TomlUtil.SetMinMaxTTLAsync(this.tomlFilePath, TimeSpan.FromMinutes(1d), TimeSpan.FromMinutes(2d), cancellationToken);
|
||||||
|
|
||||||
if (OperatingSystem.IsWindows() && Environment.UserInteractive == false)
|
if (OperatingSystem.IsWindows() && Environment.UserInteractive == false)
|
||||||
|
|||||||
@ -36,11 +36,23 @@ namespace FastGithub.DomainResolve
|
|||||||
/// <param name="logLevel"></param>
|
/// <param name="logLevel"></param>
|
||||||
/// <param name="cancellationToken"></param>
|
/// <param name="cancellationToken"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static Task SetlogLevelAsync(string tomlPath, int logLevel, CancellationToken cancellationToken)
|
public static Task SetLogLevelAsync(string tomlPath, int logLevel, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
return SetAsync(tomlPath, "log_level", new TomlInteger { Value = logLevel }, cancellationToken);
|
return SetAsync(tomlPath, "log_level", new TomlInteger { Value = logLevel }, cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 设置负载均衡模式
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="tomlPath"></param>
|
||||||
|
/// <param name="value"></param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static Task SetLBStrategyAsync(string tomlPath, string value, CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
return SetAsync(tomlPath, "lb_strategy", new TomlString { Value = value }, cancellationToken);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 设置TTL
|
/// 设置TTL
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -59,7 +71,7 @@ namespace FastGithub.DomainResolve
|
|||||||
await SetAsync(tomlPath, "cache_max_ttl", maxValue, cancellationToken);
|
await SetAsync(tomlPath, "cache_max_ttl", maxValue, cancellationToken);
|
||||||
await SetAsync(tomlPath, "cache_neg_max_ttl", maxValue, cancellationToken);
|
await SetAsync(tomlPath, "cache_neg_max_ttl", maxValue, cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 设置指定键的值
|
/// 设置指定键的值
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user