等 redis ready 了再发送
client.on('ready',function(err){ https.get('https://encrypted.google.com', (res) => { // console.log('statusCode:', res.statusCode); // console.log('headers:', res.headers); var rawData = ''; res.on('data', (chunk) => { rawData += chunk }); res.on('end', () => { client.set('data', rawData, redis.print); client.get('data', redis.print); }) }).on('error', (e) => { console.error(e); }); console.log('ready'); });
等 redis ready 了再发送