node-redis icon indicating copy to clipboard operation
node-redis copied to clipboard

set key using setnx success in 2 different child process at the same time

Open jimsproject opened this issue 13 years ago • 1 comments

Hi All,

i have 2 child process that set the same key using setnx. why i get both process returned 1?

thank you

jimmy

jimsproject avatar Sep 09 '13 13:09 jimsproject

Hi @jimsproject -- I don't see the same thing. Perhaps you're confusing the sync reply for the command being queued with the async reply in the callback?

When I try:

Client 1:

> c.setnx("12341234", "foo", console.log)
true
> null 1

Client 2:

> c.setnx("12341234", "blah blah", console.log)
true
> null 0

Perhaps you could show us the code you're using?

brycebaril avatar Sep 09 '13 14:09 brycebaril