fix redis error (#88)

Co-authored-by: dylan <wangdi@xiaoheiban.cn>
master
dylanNew 4 years ago committed by GitHub
parent b6b8941a18
commit 3e7e466526
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -13,15 +13,13 @@ const (
// maps as k in the error rate table // maps as k in the error rate table
maps = 14 maps = 14
setScript = ` setScript = `
local key = KEYS[1]
for _, offset in ipairs(ARGV) do for _, offset in ipairs(ARGV) do
redis.call("setbit", key, offset, 1) redis.call("setbit", KEYS[1], offset, 1)
end end
` `
testScript = ` testScript = `
local key = KEYS[1]
for _, offset in ipairs(ARGV) do for _, offset in ipairs(ARGV) do
if tonumber(redis.call("getbit", key, offset)) == 0 then if tonumber(redis.call("getbit", KEYS[1], offset)) == 0 then
return false return false
end end
end end

Loading…
Cancel
Save