Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

generic-pool

Package Overview
Dependencies
Maintainers
2
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

generic-pool - npm Package Compare versions

Comparing version 2.4.4 to 2.4.6

10

CHANGELOG.md
# Change Log
## [2.4.6] - November 12 2016
- linting fixes and pkg improvements
## [2.4.5] - November 12 2016
- previously broken refreshIdle functionality is now unbroken (@sandfox)
## [2.4.4] - November 7 2016

@@ -115,3 +121,5 @@ - drain is now always async to prevent zalgo-ing (@thefourtheye)

[unreleased]: https://github.com/coopernurse/node-pool/compare/v2.4.4...HEAD
[unreleased]: https://github.com/coopernurse/node-pool/compare/v2.4.6...HEAD
[2.4.6]: https://github.com/coopernurse/node-pool/compare/v2.4.5...v2.4.6
[2.4.5]: https://github.com/coopernurse/node-pool/compare/v2.4.4...v2.4.5
[2.4.4]: https://github.com/coopernurse/node-pool/compare/v2.4.3...v2.4.4

@@ -118,0 +126,0 @@ [2.4.3]: https://github.com/coopernurse/node-pool/compare/v2.4.2...v2.4.3

15

lib/generic-pool.js

@@ -119,3 +119,3 @@ /**

* @param {RefreshIdle} factory.refreshIdle
* Should idle resources be destroyed and recreated every idleTimeoutMillis? Default: true.
* Should idle resources at or below the min threshold be destroyed and recreated every idleTimeoutMillis? Default: true.
* @param {Bool} [factory.returnToHead=false]

@@ -207,4 +207,5 @@ * Returns released object to head of available objects list

var i
var al
var tr
var al = this._availableObjects.length
var refreshIdle = this._factory.refreshIdle
var maxRemovable = this._count - this._factory.min
var timeout

@@ -216,3 +217,3 @@

// check if they have timed out
for (i = 0, al = this._availableObjects.length; i < al && (this._factory.refreshIdle && (this._count - this._factory.min > toRemove.length)); i += 1) {
for (i = 0; i < al && (refreshIdle || (maxRemovable > toRemove.length)); i++) {
timeout = this._availableObjects[i].timeout

@@ -226,6 +227,6 @@ if (now >= timeout) {

for (i = 0, tr = toRemove.length; i < tr; i += 1) {
this.destroy(toRemove[i])
}
toRemove.forEach(this.destroy, this)
// NOTE: we are re-calcing this value because it may have changed
// after destroying items above
// Replace the available items with the ones to keep.

@@ -232,0 +233,0 @@ al = this._availableObjects.length

{
"name": "generic-pool",
"description": "Generic resource pooling for Node.JS",
"version": "2.4.4",
"version": "2.4.6",
"author": "James Cooper <james@bitmechanic.com>",

@@ -77,3 +77,6 @@ "contributors": [

},
"publishConfig" : {
"tag": "2.4.x"
},
"license": "MIT"
}
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