Skip to content

Instantly share code, notes, and snippets.

@catwell
Created June 6, 2012 09:32
Show Gist options
  • Save catwell/2880931 to your computer and use it in GitHub Desktop.
Save catwell/2880931 to your computer and use it in GitHub Desktop.
setnxex
if redis.call('exists',KEYS[1]) > 0 then
return 0
else
redis.call('setex',KEYS[1],ARGV[1],ARGV[2])
return 1
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment