INFO("Need %i more connections to reach min connections (%i)", spawn, pool->min);
+ /*
+ * But if we're already at "min", then don't spawn more,
+ * and we don't have any extra idle connections.
+ */
+ } else if ((pool->num + pool->pending) >= pool->min) {
+ spawn = 0;
+ extra = 0;
+
/*
* If we're about to create more than "max",
* don't create more.
*/
spawn = 0;
- /*
- * But if the pool size is already "min", we
- * don't delete them.
- */
- if ((pool->num + pool->pending) >= pool->min) {
- extra = 0;
- }
-
/* Otherwise, leave extra alone from above */
/*