Skip to content
Discussion options

You must be logged in to vote

Sorry, I forgot that part of the context: unfortunately I need to set an expire time on the lock as well. So that would result in two calls as well. In fact that was how I first did it, with a setnx() and then a setex(), but I came across scenarios where the second call failed, leading to locks living indefinitely.

Ah right. What about keeping what you have but replace set with ValueCommands#setGet(key,value,setArgs)?

Replies: 2 comments 8 replies

Comment options

You must be logged in to vote
8 replies
@machi1990
Comment options

@TheBroach
Comment options

@machi1990
Comment options

Answer selected by TheBroach
@TheBroach
Comment options

@machi1990
Comment options

@cescoffier
Comment options

@TheBroach
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
4 participants