Socket
Socket
Sign inDemoInstall

tarn

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tarn - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

13

lib/Pool.js

@@ -22,2 +22,3 @@ const { Resource } = require('./Resource');

'acquireTimeoutMillis',
'propagateCreateError',
'createTimeoutMillis',

@@ -100,2 +101,3 @@ 'idleTimeoutMillis',

this.createRetryIntervalMillis = opt.createRetryIntervalMillis || 200;
this.propagateCreateError = !!opt.propagateCreateError;

@@ -290,2 +292,13 @@ this.min = opt.min;

.catch(err => {
if (this.propagateCreateError && this.pendingAcquires.length !== 0) {
// If propagateCreateError is true, we don't retry the create
// but reject the first pending acquire immediately. Intentionally
// use `this.pendingAcquires` instead of `pendingAcquiresBeforeCreate`
// in case some acquires in pendingAcquiresBeforeCreate have already
// been resolved.
this.pendingAcquires[0].reject(err);
}
// Save the create error to all pending acquires so that we can use it
// as the error to reject the acquire if it times out.
pendingAcquiresBeforeCreate.forEach(pendingAcquire => {

@@ -292,0 +305,0 @@ pendingAcquire.possibleTimeoutCause = err;

14

package.json
{
"name": "tarn",
"version": "1.0.0",
"version": "1.1.0",
"description": "Simple and robust resource pool for node.js",

@@ -23,12 +23,4 @@ "main": "lib/tarn.js",

},
"keywords": [
"pool",
"pooling",
"throttle"
],
"files": [
"README.md",
"LICENSE",
"lib/*"
],
"keywords": ["pool", "pooling", "throttle"],
"files": ["README.md", "LICENSE", "lib/*"],
"devDependencies": {

@@ -35,0 +27,0 @@ "bluebird": "^3.5.1",

@@ -65,3 +65,9 @@ [![Build Status](https://travis-ci.org/Vincit/tarn.js.svg?branch=master)](https://travis-ci.org/Vincit/tarn.js)

// long long to idle after failed create before trying again
createRetryIntervalMillis: 200
createRetryIntervalMillis: 200,
// If true, when a create fails, the first pending acquire is
// rejected with the error. If this is false (the default) then
// create is retried until acquireTimeoutMillis milliseconds has
// passed.
propagateCreateError: false
});

@@ -68,0 +74,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc