Redis 分布式锁 优化 - 直接写lua脚本

v1.4.1
Parker 5 years ago
parent 5f51831771
commit ed53659c0e

@ -15,5 +15,5 @@ if redis.call('hexists', KEYS[1], ARGV[1]) == 1 then
redis.call('pexpire', KEYS[1], expire_time)
return 1
end
-- 没抢到锁,返回锁的剩余有效时间ms
-- 没抢到锁,返回失败
return 0
Loading…
Cancel
Save