add configurable redis pool and allow redis timeout
This commit is contained in:
@@ -124,7 +124,7 @@ public class Startup
|
|||||||
new RedisHost(){ Host = address, Port = port },
|
new RedisHost(){ Host = address, Port = port },
|
||||||
},
|
},
|
||||||
AllowAdmin = true,
|
AllowAdmin = true,
|
||||||
ConnectTimeout = 3000,
|
ConnectTimeout = options.ConnectTimeout,
|
||||||
Database = 0,
|
Database = 0,
|
||||||
Ssl = false,
|
Ssl = false,
|
||||||
Password = options.Password,
|
Password = options.Password,
|
||||||
@@ -135,7 +135,8 @@ public class Startup
|
|||||||
UnreachableServerAction = ServerEnumerationStrategy.UnreachableServerActionOptions.Throw,
|
UnreachableServerAction = ServerEnumerationStrategy.UnreachableServerActionOptions.Throw,
|
||||||
},
|
},
|
||||||
MaxValueLength = 1024,
|
MaxValueLength = 1024,
|
||||||
PoolSize = 50,
|
PoolSize = mareConfig.GetValue(nameof(ServerConfiguration.RedisPool), 50),
|
||||||
|
SyncTimeout = options.SyncTimeout,
|
||||||
};
|
};
|
||||||
|
|
||||||
services.AddStackExchangeRedisExtensions<SystemTextJsonSerializer>(redisConfiguration);
|
services.AddStackExchangeRedisExtensions<SystemTextJsonSerializer>(redisConfiguration);
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ namespace MareSynchronosShared.Utils;
|
|||||||
public class ServerConfiguration : MareConfigurationAuthBase
|
public class ServerConfiguration : MareConfigurationAuthBase
|
||||||
{
|
{
|
||||||
public string RedisConnectionString { get; set; } = string.Empty;
|
public string RedisConnectionString { get; set; } = string.Empty;
|
||||||
|
public int RedisPool { get; set; } = 50;
|
||||||
|
|
||||||
[RemoteConfiguration]
|
[RemoteConfiguration]
|
||||||
public Uri CdnFullUrl { get; set; } = null;
|
public Uri CdnFullUrl { get; set; } = null;
|
||||||
@@ -32,6 +33,7 @@ public class ServerConfiguration : MareConfigurationAuthBase
|
|||||||
sb.AppendLine($"{nameof(CdnShardConfiguration)} => {string.Join(", ", CdnShardConfiguration.Select(c => c.ToString()))}");
|
sb.AppendLine($"{nameof(CdnShardConfiguration)} => {string.Join(", ", CdnShardConfiguration.Select(c => c.ToString()))}");
|
||||||
sb.AppendLine($"{nameof(StaticFileServiceAddress)} => {StaticFileServiceAddress}");
|
sb.AppendLine($"{nameof(StaticFileServiceAddress)} => {StaticFileServiceAddress}");
|
||||||
sb.AppendLine($"{nameof(RedisConnectionString)} => {RedisConnectionString}");
|
sb.AppendLine($"{nameof(RedisConnectionString)} => {RedisConnectionString}");
|
||||||
|
sb.AppendLine($"{nameof(RedisPool)} => {RedisPool}");
|
||||||
sb.AppendLine($"{nameof(MaxExistingGroupsByUser)} => {MaxExistingGroupsByUser}");
|
sb.AppendLine($"{nameof(MaxExistingGroupsByUser)} => {MaxExistingGroupsByUser}");
|
||||||
sb.AppendLine($"{nameof(MaxJoinedGroupsByUser)} => {MaxJoinedGroupsByUser}");
|
sb.AppendLine($"{nameof(MaxJoinedGroupsByUser)} => {MaxJoinedGroupsByUser}");
|
||||||
sb.AppendLine($"{nameof(MaxGroupUserCount)} => {MaxGroupUserCount}");
|
sb.AppendLine($"{nameof(MaxGroupUserCount)} => {MaxGroupUserCount}");
|
||||||
|
|||||||
Reference in New Issue
Block a user