redis-connection-pool
Advanced tools
Comparing version 0.0.4 to 0.0.5
{ | ||
"name": "redis-connection-pool", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "Redis client connection pool", | ||
@@ -5,0 +5,0 @@ "license": "AGPL", |
@@ -39,2 +39,7 @@ node-redis-connection-pool | ||
* **expire** | ||
``` | ||
expire(key, value) | ||
``` | ||
* **hget** | ||
@@ -41,0 +46,0 @@ ``` |
@@ -129,2 +129,17 @@ /** | ||
/** | ||
* Function: expire | ||
* | ||
* Execute a redis EXPIRE command | ||
* | ||
* Parameters: | ||
* | ||
* key - (string) - A key to assign value to | ||
* value - (number) - TTL in seconds | ||
* | ||
*/ | ||
RedisConnectionPool.prototype.expire = function (key, data) { | ||
redisSingle.apply(this, ['expire', key, data]); | ||
}; | ||
/** | ||
* Function: set | ||
@@ -336,8 +351,14 @@ * | ||
function redisSingle (funcName, key) { | ||
function redisSingle (funcName, key, val) { | ||
var pool = this.pool; | ||
pool.acquire(function (err, client) { | ||
client[funcName](key, function () { | ||
pool.release(client); | ||
}); | ||
if (val) { | ||
client[funcName](key, val, function () { | ||
pool.release(client); | ||
}); | ||
} else { | ||
client[funcName](key, function () { | ||
pool.release(client); | ||
}); | ||
} | ||
}); | ||
@@ -344,0 +365,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
246314
3540
92