using calbacks instead of step

This commit is contained in:
Simon Martín 2018-08-01 11:25:55 +02:00
parent 23ef884e9b
commit 5c0b7487f7

View File

@ -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;