Skip to content
This repository has been archived by the owner on Dec 24, 2022. It is now read-only.

Commit

Permalink
Change PooledRedisClientManager to use RedisConfig.DefaultMaxPoolSize…
Browse files Browse the repository at this point in the history
… if specified
  • Loading branch information
mythz committed Nov 27, 2015
1 parent 9694e1e commit e16b5f2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/ServiceStack.Redis/PooledRedisClientManager.cs
Expand Up @@ -128,8 +128,8 @@ public PooledRedisClientManager(IEnumerable<string> readWriteHosts, IEnumerable<

this.Config = config ?? new RedisClientManagerConfig
{
MaxWritePoolSize = masters.Length * PoolSizeMultiplier,
MaxReadPoolSize = slaves.Length * PoolSizeMultiplier,
MaxWritePoolSize = RedisConfig.DefaultMaxPoolSize ?? masters.Length * PoolSizeMultiplier,
MaxReadPoolSize = RedisConfig.DefaultMaxPoolSize ?? slaves.Length * PoolSizeMultiplier,
};

this.OnFailover = new List<Action<IRedisClientsManager>>();
Expand Down Expand Up @@ -655,6 +655,9 @@ public void Start()
{"readClientsWithExceptions", "" + readClientsWithExceptions},
{"readClientsInUse", "" + readClientsInUse},
{"readClientsConnected", "" + readClientsConnected},

{"RedisResolver.ReadOnlyHostsCount", "" + RedisResolver.ReadOnlyHostsCount},
{"RedisResolver.ReadWriteHostsCount", "" + RedisResolver.ReadWriteHostsCount},
};

return ret;
Expand Down
2 changes: 1 addition & 1 deletion src/ServiceStack.Redis/RedisManagerPool.cs
Expand Up @@ -48,7 +48,7 @@ public partial class RedisManagerPool

public IRedisResolver RedisResolver { get; set; }

public int MaxPoolSize { get; set; }
public int MaxPoolSize { get; private set; }

public RedisManagerPool() : this(RedisConfig.DefaultHost) { }
public RedisManagerPool(string host) : this(new[] { host }) { }
Expand Down

0 comments on commit e16b5f2

Please sign in to comment.