Skip to content

Commit 4f306c6

Browse files
author
Toby Steele
committed
Fixed so that PoolSize cannot become negative. Made sure pooling not kicked off if _parameters.Pooling==false
1 parent 5fe3eca commit 4f306c6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/AdoNetCore.AseClient/Internal/ConnectionPool.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public ConnectionPool(IConnectionParameters parameters, IInternalConnectionFacto
3636

3737
PoolSize = 0;
3838

39-
if (_parameters.MinPoolSize > 0)
39+
if (_parameters.Pooling && _parameters.MinPoolSize > 0)
4040
{
4141
Task.Run(TryFillPoolToMinSize);
4242
Logger.Instance?.WriteLine("Pool fill task started");
@@ -260,7 +260,10 @@ private void RemoveConnection(IInternalConnection connection = null)
260260
}
261261
finally
262262
{
263-
PoolSize--;
263+
if (PoolSize > 0)
264+
{
265+
PoolSize--;
266+
}
264267
}
265268
}
266269
}

0 commit comments

Comments
 (0)