Skip to content

Commit

Permalink
[CritFix] Neural: Fix keys regression after #3968
Browse files Browse the repository at this point in the history
  • Loading branch information
vstakhov committed Jun 27, 2022
1 parent e872e68 commit f9cfbba
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lualib/plugins/neural.lua
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ local redis_lua_script_vectors_len = [[
local nspam = 0
local nham = 0
local ret = redis.call('LLEN', prefix .. '_spam')
local ret = redis.call('SCARD', prefix .. '_spam_set')
if ret then nspam = tonumber(ret) end
ret = redis.call('LLEN', prefix .. '_ham')
ret = redis.call('SCARD', prefix .. '_ham_set')
if ret then nham = tonumber(ret) end
return {nspam,nham}
Expand All @@ -133,8 +133,8 @@ local redis_lua_script_maybe_invalidate = [[
if type(tb) == 'table' and type(tb.redis_key) == 'string' then
redis.call('DEL', tb.redis_key)
-- Also train vectors
redis.call('DEL', tb.redis_key .. '_spam')
redis.call('DEL', tb.redis_key .. '_ham')
redis.call('DEL', tb.redis_key .. '_spam_set')
redis.call('DEL', tb.redis_key .. '_ham_set')
end
end
end
Expand Down Expand Up @@ -181,8 +181,8 @@ local redis_lua_script_save_unlock = [[
local now = tonumber(KEYS[6])
redis.call('ZADD', KEYS[2], now, KEYS[4])
redis.call('HSET', KEYS[1], 'ann', KEYS[3])
redis.call('DEL', KEYS[1] .. '_spam')
redis.call('DEL', KEYS[1] .. '_ham')
redis.call('DEL', KEYS[1] .. '_spam_set')
redis.call('DEL', KEYS[1] .. '_ham_set')
redis.call('HDEL', KEYS[1], 'lock')
redis.call('HDEL', KEYS[7], 'lock')
redis.call('EXPIRE', KEYS[1], tonumber(KEYS[5]))
Expand Down

0 comments on commit f9cfbba

Please sign in to comment.