Skip to content

Instantly share code, notes, and snippets.

@stockholmux
Last active June 18, 2019 09:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save stockholmux/7fcf8ef4ad253045280a0aee34318182 to your computer and use it in GitHub Desktop.
Save stockholmux/7fcf8ef4ad253045280a0aee34318182 to your computer and use it in GitHub Desktop.
index.js
//with a previously create client
client.set('some-key','42',function(err) {
if (err) {
throw err; /* in production, handle errors more gracefully */
} else {
client.get('some-key',function(err,value) {
if (err) {
throw err;
} else {
console.log(value);
}
}
);
});
@ankitmalikfun
Copy link

ankitmalikfun commented Nov 25, 2018

Issue: else part is not closed properly.

client.set('some-key','42',function(err) {
if (err) {
throw err; /* in production, handle errors more gracefully */
} else {
client.get('some-key',function(err,value) {
if (err) {
throw err;
} else {
console.log(value);
}
});
}
});

@tgrall
Copy link

tgrall commented Jun 18, 2019

I have forked this example to make it works (missing closing bracket)

https://gist.github.com/tgrall/ad2239ee53e0617004ddc6dc34f6636f#file-node_redis_commands-js-L14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment