Fix set_max_idle_connections(0).
This broke during some recent refactorings. The special case branch for max_connections == 0 wasn't actually setting the max_idle_connections field. This change simply deletes that branch, since the existing code that whittles down the pool size one element at a time suffices. In the common case this will be set on an empty pool anyhow.
This commit is contained in:
committed by
Martin Algesten
parent
11413726cd
commit
b01be808c5
@@ -79,13 +79,6 @@ impl ConnectionPool {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if max_connections == 0 {
|
|
||||||
// Clear the connection pool, caching is disabled.
|
|
||||||
self.lru.clear();
|
|
||||||
self.recycle.clear();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Remove any extra connections if the number was decreased.
|
// Remove any extra connections if the number was decreased.
|
||||||
while self.lru.len() > max_connections {
|
while self.lru.len() > max_connections {
|
||||||
self.remove_oldest();
|
self.remove_oldest();
|
||||||
|
|||||||
Reference in New Issue
Block a user