mirror of
https://github.com/LamGC/ContentGrabbingJi.git
synced 2025-04-29 14:17:33 +00:00
[Fix] CacheStore-Redis 修复 RemoveElementByIndex 脚本返回值不统一的问题;
[Fix] RemoveElementByIndex.lua 修复失败返回值不统一的问题;
This commit is contained in:
parent
1c298c11ec
commit
074e71014a
@ -2,7 +2,7 @@ local key = tostring(KEYS[1])
|
||||
local index = tonumber(ARGV[1])
|
||||
|
||||
if (key == nil) or (index == nil) then
|
||||
return -1
|
||||
return 0
|
||||
end
|
||||
|
||||
local function getRandom(n)
|
||||
@ -21,7 +21,7 @@ end;
|
||||
local flag = getRandom(24)
|
||||
|
||||
if (redis.call("llen", key) <= index) or redis.call("lIndex", key, index) == nil then
|
||||
return -1
|
||||
return 0
|
||||
else
|
||||
redis.call("lSet", key, index, flag);
|
||||
return redis.call("lRem", key, 0, flag);
|
||||
|
Loading…
Reference in New Issue
Block a user