Skip to content

Instantly share code, notes, and snippets.

@springmeyer
Created May 20, 2011 20:19
Show Gist options
  • Save springmeyer/983713 to your computer and use it in GitHub Desktop.
Save springmeyer/983713 to your computer and use it in GitHub Desktop.
diff --git a/lib/generic-pool.js b/lib/generic-pool.js
index e98d9ca..5808d1b 100644
--- a/lib/generic-pool.js
+++ b/lib/generic-pool.js
@@ -242,10 +242,10 @@ exports.Pool = function (factory) {
*/
me.release = function (obj) {
//log("return to pool");
+ dispense();
var objWithTimeout = { obj: obj, timeout: (new Date().getTime() + idleTimeoutMillis) };
availableObjects.push(objWithTimeout);
log("timeout: " + objWithTimeout.timeout);
- dispense();
scheduleRemoveIdle();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment