stream.on('data', (keys) => { if (keys.length > 0) { const pipeline = client.pipeline(); for (let i = 0; i < keys.length; i++) { pipeline.del(keys[i]); } pipeline.exec(); } });
stream.on('data', (resultKeys) => { stream.pause(); pipeline = redis.pipeline(); for (let i = 0; i < resultKeys.length; i++) { pipeline.object('idletime', resultKeys[i]); } pipeline.exec() .then((idleTimes) => { for (let i = 0; i < idleTimes.length; i++) { oldestIdle = Math.max(oldestIdle, idleTimes[i][1]); } stream.resume(); }) .catch((err) => { console.log(err); process.exit(1); }); });
describe('No metrics data in Redis', () => { before(done => { redis.keys('*:test:bb:*').then(keys => { const pipeline = redis.pipeline(); keys.forEach(key => { pipeline.del(key);