keys.forEach(function(stats){ memcached.cachedump(itemSet.server, parseInt(stats) , 0, function( err, response ){ if (response) { if(response instanceof Array ) { response.forEach(function(cacheItem){ callback(cacheItem); }); } else { callback(response); } } }) });
servers.forEach(function(s) { memcached.cachedump(s, parseInt(sid), 0, function(a, b) { if (!(b instanceof Array)) { b = [b]; } b.forEach(function(k) { if (k.key === sk) { console.log(' - key', k); console.log(' - now is', new Date()); console.log(' - exp in', new Date(k.s * 1000)); } }) }); });
keys.forEach(function( stats ){ // get a cachedump for each slabid and slab.number slabid = parseInt(stats); item = itemSet[slabid]; console.log(slabid, item.number, item.age); nmc.cachedump(itemSet.server, slabid, item.number, function(err,response ){ // dump the shizzle if(err) console.log(err); // JSON.stringify( response ); if(util.isArray(response)) { response.forEach(function(ele){ if(ele.key[0]==='w'&&ele.key[1]==='x') console.log('arkey:',ele.key); }); }else{ if(response.key[0]==='w'&& response.key[1]==='x') console.log('key:', response.key); } }); });
exports.cachedump = function(server, status, number, callback){ m.cachedump(server,status,number,function(err,results){ GlobalCallBack(err,results,"cachedump",callback); }) }