local function print_changes(changes)
local function print_change(k, c, where)
printf('File: %s, changes list:', highlight(local_conf .. '/'
- .. where .. '/'.. k .. '.conf'))
+ .. where .. '/'.. k))
for ek,ev in pairs(c) do
printf("%s => %s", highlight(ek), rspamd_logger.slog("%s", ev))
end
local function apply_change(k, c, where)
- local fname = local_conf .. '/' .. where .. '/'.. k .. '.conf'
+ local fname = local_conf .. '/' .. where .. '/'.. k
if not rspamd_util.file_exists(fname) then
printf("Create file %s", highlight(fname))
printf("Conversion failed")
else
printf("Conversion succeed")
- changes.l['classifier_bayes'] = {
+ changes.l['classifier-bayes.conf'] = {
new_schema = true,
}
if expire then
- changes.l['classifier_bayes'].expire = expire
+ changes.l['classifier-bayes.conf'].expire = expire
end
end
end
symbol_ham, symbol_spam)
if ask_yes_no("Switch config to the new schema?", true) then
- changes.l['classifier_bayes'] = {
+ changes.l['classifier-bayes.conf'] = {
new_schema = true,
}
local expire = check_expire()
if expire then
- changes.l['classifier_bayes'].expire = expire
+ changes.l['classifier-bayes.conf'].expire = expire
end
end
end
return false
end
rspamd_logger.messagex('Converted classifier to the from sqlite to redis')
- changes.l['classifier_bayes'] = {
+ changes.l['classifier-bayes.conf'] = {
backend = 'redis',
new_schema = true,
}
if expire then
- changes.l['classifier_bayes'].expire = expire
+ changes.l['classifier-bayes.conf'].expire = expire
end
if cls.learn_cache then
- changes.l['classifier_bayes'].cache = {
+ changes.l['classifier-bayes.conf'].cache = {
backend = 'redis'
}
end