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:
Jacob Hoffman-Andrews
2020-09-25 00:10:35 -07:00
committed by Martin Algesten
parent 11413726cd
commit b01be808c5

View File

@@ -79,13 +79,6 @@ impl ConnectionPool {
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.
while self.lru.len() > max_connections {
self.remove_oldest();