Skip to content

Instantly share code, notes, and snippets.

@libchaos
Last active August 16, 2018 12:26
Show Gist options
  • Save libchaos/1e9f905d656df2a18e7a14edfe6cf4f9 to your computer and use it in GitHub Desktop.
Save libchaos/1e9f905d656df2a18e7a14edfe6cf4f9 to your computer and use it in GitHub Desktop.
node
app.get('/dog/age/:age', (req, res) => {
redis.lrange('dog:age:' + req.params.age)
.then((data) => Promise.all(data.map(redis.hgetall)))
.then((data) => res.send(data));
console.timeEnd('request');
})
app.get('/dog/age/:age', (req, res) => {
redis.lrange('dog:age:'+req.params.age)
.then((data)=> {
Promise.all(data.map(redis.hgetall))
console.log('done') //this destroy the programm how can I find the reason
//seems only in oneline that can run.
})
.then((data) => res.send(data))
console.timeEnd('request')
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment