moved debugs 1 level up increased key limit to 100

This commit is contained in:
barisusakli
2014-09-06 20:47:20 -04:00
parent 57e204df8e
commit fe58ea55d4
3 changed files with 15 additions and 14 deletions

View File

@@ -23,7 +23,10 @@ module.exports = function(db, module) {
};
module.getObjects = function(keys, callback) {
helpers.checkKeys(keys);
if (keys.length > helpers.KEY_LIMIT) {
var e = new Error('too many keys');
winston.warn('[HASH - TOO_MANY_KEYS] ' + keys.length + ' ' + keys[0] + ' ' + keys[keys.length - 1] + '\n', e.stack);
}
db.collection('objects').find({_key: {$in: keys}}, {_id: 0}).toArray(function(err, data) {
if(err) {
return callback(err);
@@ -54,7 +57,11 @@ module.exports = function(db, module) {
};
module.getObjectsFields = function(keys, fields, callback) {
helpers.checkKeys(keys);
if (keys.length > helpers.KEY_LIMIT) {
var e = new Error('too many keys');
winston.warn('[HASH - TOO_MANY_KEYS] ' + keys.length + ' ' + keys[0] + ' ' + keys[keys.length - 1] + '\n', e.stack);
}
var _fields = {
_id: 0,
_key: 1