From 3e7e466526bf1663de5844e4813a62d94714a259 Mon Sep 17 00:00:00 2001 From: dylanNew Date: Mon, 21 Sep 2020 16:37:40 +0800 Subject: [PATCH] fix redis error (#88) Co-authored-by: dylan --- core/bloom/bloom.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/core/bloom/bloom.go b/core/bloom/bloom.go index fec8b545..22793878 100644 --- a/core/bloom/bloom.go +++ b/core/bloom/bloom.go @@ -13,15 +13,13 @@ const ( // maps as k in the error rate table maps = 14 setScript = ` -local key = KEYS[1] for _, offset in ipairs(ARGV) do - redis.call("setbit", key, offset, 1) + redis.call("setbit", KEYS[1], offset, 1) end ` testScript = ` -local key = KEYS[1] 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 end end