add configurable redis pool and allow redis timeout

This commit is contained in:
rootdarkarchon
2023-01-18 11:11:59 +01:00
parent e97f4cb6d6
commit 35f61d5387
2 changed files with 5 additions and 2 deletions

View File

@@ -124,7 +124,7 @@ public class Startup
new RedisHost(){ Host = address, Port = port },
},
AllowAdmin = true,
ConnectTimeout = 3000,
ConnectTimeout = options.ConnectTimeout,
Database = 0,
Ssl = false,
Password = options.Password,
@@ -135,7 +135,8 @@ public class Startup
UnreachableServerAction = ServerEnumerationStrategy.UnreachableServerActionOptions.Throw,
},
MaxValueLength = 1024,
PoolSize = 50,
PoolSize = mareConfig.GetValue(nameof(ServerConfiguration.RedisPool), 50),
SyncTimeout = options.SyncTimeout,
};
services.AddStackExchangeRedisExtensions<SystemTextJsonSerializer>(redisConfiguration);