mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-05-10 08:29:58 +08:00
feat: migrate lua script to lua file (#4069)
This commit is contained in:
6
core/stores/redis/lockscript.lua
Normal file
6
core/stores/redis/lockscript.lua
Normal file
@@ -0,0 +1,6 @@
|
||||
if redis.call("GET", KEYS[1]) == ARGV[1] then
|
||||
redis.call("SET", KEYS[1], ARGV[1], "PX", ARGV[2])
|
||||
return "OK"
|
||||
else
|
||||
return redis.call("SET", KEYS[1], ARGV[1], "NX", "PX", ARGV[2])
|
||||
end
|
||||
Reference in New Issue
Block a user