using calbacks instead of step
This commit is contained in:
parent
23ef884e9b
commit
5c0b7487f7
@ -73,21 +73,17 @@ TemplateMaps.prototype._redisCmd = function(redisFunc, redisArgs, callback) {
|
||||
var that = this;
|
||||
var db = that.db_signatures;
|
||||
|
||||
function getRedisClient() {
|
||||
that.redis_pool.acquire(db, this);
|
||||
},
|
||||
function executeQuery(err, data) {
|
||||
that.redis_pool.acquire(db, (err, data) => {
|
||||
assert.ifError(err);
|
||||
redisClient = data;
|
||||
redisArgs.push(this);
|
||||
redisArgs.push((err, data) => {
|
||||
if ( ! _.isUndefined(redisClient) ) {
|
||||
that.redis_pool.release(db, redisClient);
|
||||
}
|
||||
callback(err, data);
|
||||
});
|
||||
redisClient[redisFunc.toUpperCase()].apply(redisClient, redisArgs);
|
||||
},
|
||||
function releaseRedisClient(err, data) {
|
||||
if ( ! _.isUndefined(redisClient) ) {
|
||||
that.redis_pool.release(db, redisClient);
|
||||
}
|
||||
callback(err, data);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var _reValidNameIdentifier = /^[a-z0-9][0-9a-z_\-]*$/i;
|
||||
|
Loading…
Reference in New Issue
Block a user