sequelize-pool
Advanced tools
Comparing version 2.0.0 to 2.1.0
@@ -384,4 +384,4 @@ "use strict"; | ||
destroy(resource) { | ||
this._count -= 1; | ||
if (this._count < 0) this._count = 0; | ||
const available = this._availableObjects.length; | ||
const using = this._inUseObjects.length; | ||
@@ -395,2 +395,14 @@ this._availableObjects = this._availableObjects.filter( | ||
// resource was not removed, then no need to decrement _count | ||
if ( | ||
available === this._availableObjects.length && | ||
using === this._inUseObjects.length | ||
) { | ||
this._ensureMinimum(); | ||
return; | ||
} | ||
this._count -= 1; | ||
if (this._count < 0) this._count = 0; | ||
this._factory.destroy(resource); | ||
@@ -397,0 +409,0 @@ this._ensureMinimum(); |
{ | ||
"name": "sequelize-pool", | ||
"description": "Resource pooling for Node.JS", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"author": "Sushant <sushantdhiman@outlook.com>", | ||
@@ -23,6 +23,6 @@ "keywords": [ | ||
"eslint": "^5.16.0", | ||
"eslint-config-prettier": "^4.1.0", | ||
"eslint-plugin-prettier": "^3.0.1", | ||
"eslint-config-prettier": "^4.3.0", | ||
"eslint-plugin-prettier": "^3.1.0", | ||
"prettier": "1.16.4", | ||
"tap": "^12.6.1" | ||
"tap": "^12.7.0" | ||
}, | ||
@@ -29,0 +29,0 @@ "engines": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21263
461