mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-19 12:28:15 +08:00
- 优化 PrevReheatConnectionPool 预热;
This commit is contained in:
@ -669,8 +669,9 @@ namespace FreeSql.Internal
|
||||
|
||||
public static void PrevReheatConnectionPool(ObjectPool<DbConnection> pool, int minPoolSize)
|
||||
{
|
||||
if (minPoolSize <= 0) minPoolSize = Math.Min(5, pool.Policy.PoolSize);
|
||||
if (minPoolSize > pool.Policy.PoolSize) minPoolSize = pool.Policy.PoolSize;
|
||||
var maxPoolSize = pool.Policy.PoolSize - 1;
|
||||
if (minPoolSize <= 0) minPoolSize = Math.Min(5, maxPoolSize);
|
||||
if (minPoolSize > maxPoolSize) minPoolSize = maxPoolSize;
|
||||
var initTestOk = true;
|
||||
var initStartTime = DateTime.Now;
|
||||
var initConns = new ConcurrentBag<Object<DbConnection>>();
|
||||
|
Reference in New Issue
Block a user