This repository was archived by the owner on Dec 24, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +20
-13
lines changed Expand file tree Collapse file tree 3 files changed +20
-13
lines changed Original file line number Diff line number Diff line change 12
12
13
13
namespace ServiceStack . Redis
14
14
{
15
- public class RedisClientManagerConfig
16
- {
17
- public RedisClientManagerConfig ( )
18
- {
19
- AutoStart = true ; //Simplifies the most common use-case - registering in an IOC
20
- }
15
+ public class RedisClientManagerConfig
16
+ {
17
+ public RedisClientManagerConfig ( )
18
+ {
19
+ AutoStart = true ; //Simplifies the most common use-case - registering in an IOC
20
+ }
21
21
22
- public long ? DefaultDb { get ; set ; }
23
- public int MaxReadPoolSize { get ; set ; }
24
- public int MaxWritePoolSize { get ; set ; }
25
- public bool AutoStart { get ; set ; }
26
- }
22
+ public long ? DefaultDb { get ; set ; }
23
+ public int MaxReadPoolSize { get ; set ; }
24
+ public int MaxWritePoolSize { get ; set ; }
25
+ public bool AutoStart { get ; set ; }
26
+ }
27
27
}
Original file line number Diff line number Diff line change @@ -47,6 +47,11 @@ public class RedisConfig
47
47
/// </summary>
48
48
public static int DefaultRetryTimeout = 3 * 1000 ;
49
49
50
+ /// <summary>
51
+ /// Default Max Pool Size for Pooled Redis Client Managers (default none)
52
+ /// </summary>
53
+ public static int ? DefaultMaxPoolSize ;
54
+
50
55
/// <summary>
51
56
/// The BackOff multiplier failed Auto Retries starts from (default 10ms)
52
57
/// </summary>
@@ -104,6 +109,7 @@ public static void Reset()
104
109
DefaultReceiveTimeout = - 1 ;
105
110
DefaultRetryTimeout = 3 * 1000 ;
106
111
DefaultIdleTimeOutSecs = 240 ;
112
+ DefaultMaxPoolSize = null ;
107
113
BackOffMultiplier = 10 ;
108
114
BufferLength = 1450 ;
109
115
BufferPoolMaxSize = 500000 ;
Original file line number Diff line number Diff line change @@ -12,11 +12,11 @@ namespace ServiceStack.Redis
12
12
{
13
13
public class RedisPoolConfig
14
14
{
15
- public const int DefaultMaxPoolSize = 40 ;
15
+ public static int DefaultMaxPoolSize = 40 ;
16
16
17
17
public RedisPoolConfig ( )
18
18
{
19
- MaxPoolSize = DefaultMaxPoolSize ;
19
+ MaxPoolSize = RedisConfig . DefaultMaxPoolSize ?? DefaultMaxPoolSize ;
20
20
}
21
21
22
22
public int MaxPoolSize { get ; set ; }
@@ -52,6 +52,7 @@ public partial class RedisManagerPool
52
52
53
53
public RedisManagerPool ( ) : this ( RedisConfig . DefaultHost ) { }
54
54
public RedisManagerPool ( string host ) : this ( new [ ] { host } ) { }
55
+ public RedisManagerPool ( string host , RedisPoolConfig config ) : this ( new [ ] { host } , config ) { }
55
56
public RedisManagerPool ( IEnumerable < string > hosts ) : this ( hosts , null ) { }
56
57
57
58
public RedisManagerPool ( IEnumerable < string > hosts , RedisPoolConfig config )
You can’t perform that action at this time.
0 commit comments