v1.18.x
Baris Soner Usakli 11 years ago
parent 610d45bb32
commit 3d18c4015a

@ -109,7 +109,7 @@
} }
callback(null, data[field]); callback(null, data[field]);
}) });
} }
module.getObjectFields = function(key, fields, callback) { module.getObjectFields = function(key, fields, callback) {
@ -179,7 +179,6 @@
var data = {}; var data = {};
data[field] = value; data[field] = value;
db.collection('objects').update({_key:key}, {$inc : data}, function(err, result) { db.collection('objects').update({_key:key}, {$inc : data}, function(err, result) {
console.log('incrObjectFieldBy', err, result);
module.getObjectField(key, field, function(err, value) { module.getObjectField(key, field, function(err, value) {
callback(err, value); callback(err, value);
}); });

@ -136,6 +136,10 @@
redisClient.get(key, callback); redisClient.get(key, callback);
} }
module.keys = function(key, callback) {
redisClient.keys(keym callback);
}
//hashes //hashes
module.setObject = function(key, data, callback) { module.setObject = function(key, data, callback) {

@ -153,13 +153,19 @@ var fs = require('fs'),
})); }));
next(); next();
} else next(); } else {
next();
}
} }
], function(err) { ], function(err) {
if (!err) { if (!err) {
if (global.env === 'development') winston.info('[plugins] Loaded plugin: ' + pluginData.id); if (global.env === 'development') {
winston.info('[plugins] Loaded plugin: ' + pluginData.id);
}
callback(); callback();
} else callback(new Error('Could not load plugin system')) } else {
callback(new Error('Could not load plugin system'));
}
}); });
}); });
}; };
@ -212,7 +218,9 @@ var fs = require('fs'),
next(null, value); next(null, value);
} }
} else { } else {
if (global.env === 'development') winston.info('[plugins] Expected method \'' + hookObj.method + '\' in plugin \'' + hookObj.id + '\' not found, skipping.'); if (global.env === 'development') {
winston.info('[plugins] Expected method \'' + hookObj.method + '\' in plugin \'' + hookObj.id + '\' not found, skipping.');
}
next(null, value); next(null, value);
} }
}, function(err, value) { }, function(err, value) {
@ -222,7 +230,7 @@ var fs = require('fs'),
} }
} }
callback.apply(plugins, arguments); callback.apply(Plugins, arguments);
}); });
break; break;
case 'action': case 'action':

Loading…
Cancel
Save