aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-02-23 14:33:48 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-02-23 14:33:48 +0000
commit46ca7a84233f88918faf06d8fe5ef3b5d18ba2d3 (patch)
treeff9405d36e4ebdac1f6b89681f473c703d1635ac
parent4fda9686da8300e8f187ae784819f8eb040846e5 (diff)
downloadrspamd-46ca7a84233f88918faf06d8fe5ef3b5d18ba2d3.tar.gz
rspamd-46ca7a84233f88918faf06d8fe5ef3b5d18ba2d3.zip
[Minor] Fix setting of the keys during statconvert
-rw-r--r--lualib/lua_stat.lua8
-rw-r--r--lualib/rspamadm/configwizard.lua6
2 files changed, 6 insertions, 8 deletions
diff --git a/lualib/lua_stat.lua b/lualib/lua_stat.lua
index d3a435554..5c7ca7f31 100644
--- a/lualib/lua_stat.lua
+++ b/lualib/lua_stat.lua
@@ -304,11 +304,9 @@ end
logger.errx('Cannot update learns for user: ' .. user)
return false
end
- if user ~= '' then
- if not conn:add_cmd('SADD', {symbol .. '_keys', 'RS' .. user}) then
- logger.errx('Cannot update learns for user: ' .. user)
- return false
- end
+ if not conn:add_cmd('SADD', {symbol .. '_keys', 'RS' .. user}) then
+ logger.errx('Cannot update learns for user: ' .. user)
+ return false
end
end
-- Set version
diff --git a/lualib/rspamadm/configwizard.lua b/lualib/rspamadm/configwizard.lua
index 8607cdc1e..3aabea41f 100644
--- a/lualib/rspamadm/configwizard.lua
+++ b/lualib/rspamadm/configwizard.lua
@@ -367,9 +367,9 @@ end
return ver
]]
- local ver = conn:add_cmd('EVAL', {lua_script, '1', symbol_spam})
-
- if ver ~= 2 then
+ conn:add_cmd('EVAL', {lua_script, '1', symbol_spam})
+ local _,ver = conn:exec()
+ if tonumber(ver) ~= 2 then
printf("You have configured new schema for %s/%s but your DB has old data",
symbol_spam, symbol_ham)
try_convert()