Comparing version 3.0.0 to 3.0.1
@@ -186,4 +186,9 @@ "use strict"; | ||
.then(() => { | ||
// poll every 100ms and wait that all validations are ready | ||
// eslint-disable-next-line | ||
return new Promise((resolve, reject) => { | ||
// poll every 100ms and wait that all validations are ready | ||
if (this.numPendingValidations() === 0) { | ||
resolve(); | ||
return; | ||
} | ||
const interval = setInterval(() => { | ||
@@ -280,2 +285,3 @@ if (this.numPendingValidations() === 0) { | ||
const abortAbleValidation = new PendingOperation_1.PendingOperation(this.acquireTimeoutMillis); | ||
// eslint-disable-next-line | ||
pendingAcquire.promise.catch(err => { | ||
@@ -379,3 +385,6 @@ abortAbleValidation.abort(); | ||
pendingCreate.promise = pendingCreate.promise.catch(err => { | ||
remove(this.pendingCreates, pendingCreate); | ||
if (remove(this.pendingCreates, pendingCreate)) { | ||
// TODO: figure out more consistent way for different error handlers in next rewrite | ||
this._executeEventHandlers('createFail', eventId, err); | ||
} | ||
throw err; | ||
@@ -401,6 +410,7 @@ }); | ||
} | ||
remove(this.pendingCreates, pendingCreate); | ||
if (remove(this.pendingCreates, pendingCreate)) { | ||
this._executeEventHandlers('createFail', eventId, err); | ||
} | ||
// Not returned on purpose. | ||
pendingCreate.reject(err); | ||
this._executeEventHandlers('createFail', eventId, err); | ||
return null; | ||
@@ -407,0 +417,0 @@ }); |
{ | ||
"name": "tarn", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "Simple and robust resource pool for node.js", | ||
@@ -5,0 +5,0 @@ "main": "dist/tarn.js", |
@@ -162,2 +162,6 @@ [![Build Status](https://travis-ci.org/Vincit/tarn.js.svg?branch=master)](https://travis-ci.org/Vincit/tarn.js) | ||
### 3.0.1 2020-10-25 | ||
- Added triggering missing createFail event on timeout error - fixes #57 | ||
### 3.0.0 2020-04-18 | ||
@@ -164,0 +168,0 @@ |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
40310
827
190
0