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 1212
1313namespace ServiceStack . Redis
1414{
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+ }
2121
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+ }
2727}
Original file line number Diff line number Diff line change @@ -47,6 +47,11 @@ public class RedisConfig
4747 /// </summary>
4848 public static int DefaultRetryTimeout = 3 * 1000 ;
4949
50+ /// <summary>
51+ /// Default Max Pool Size for Pooled Redis Client Managers (default none)
52+ /// </summary>
53+ public static int ? DefaultMaxPoolSize ;
54+
5055 /// <summary>
5156 /// The BackOff multiplier failed Auto Retries starts from (default 10ms)
5257 /// </summary>
@@ -104,6 +109,7 @@ public static void Reset()
104109 DefaultReceiveTimeout = - 1 ;
105110 DefaultRetryTimeout = 3 * 1000 ;
106111 DefaultIdleTimeOutSecs = 240 ;
112+ DefaultMaxPoolSize = null ;
107113 BackOffMultiplier = 10 ;
108114 BufferLength = 1450 ;
109115 BufferPoolMaxSize = 500000 ;
Original file line number Diff line number Diff line change @@ -12,11 +12,11 @@ namespace ServiceStack.Redis
1212{
1313 public class RedisPoolConfig
1414 {
15- public const int DefaultMaxPoolSize = 40 ;
15+ public static int DefaultMaxPoolSize = 40 ;
1616
1717 public RedisPoolConfig ( )
1818 {
19- MaxPoolSize = DefaultMaxPoolSize ;
19+ MaxPoolSize = RedisConfig . DefaultMaxPoolSize ?? DefaultMaxPoolSize ;
2020 }
2121
2222 public int MaxPoolSize { get ; set ; }
@@ -52,6 +52,7 @@ public partial class RedisManagerPool
5252
5353 public RedisManagerPool ( ) : this ( RedisConfig . DefaultHost ) { }
5454 public RedisManagerPool ( string host ) : this ( new [ ] { host } ) { }
55+ public RedisManagerPool ( string host , RedisPoolConfig config ) : this ( new [ ] { host } , config ) { }
5556 public RedisManagerPool ( IEnumerable < string > hosts ) : this ( hosts , null ) { }
5657
5758 public RedisManagerPool ( IEnumerable < string > hosts , RedisPoolConfig config )
You can’t perform that action at this time.
0 commit comments