aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-09-16 12:18:04 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-09-16 12:18:04 +0100
commitb7de5d08121dce7e97db3b383ce0f8124fe7ff24 (patch)
tree8c1220606578395894adf1dc83a2bdc78655f963 /src/plugins
parent774c45e3b76d28962aa83dad9552536f838bad4b (diff)
downloadrspamd-b7de5d08121dce7e97db3b383ce0f8124fe7ff24.tar.gz
rspamd-b7de5d08121dce7e97db3b383ce0f8124fe7ff24.zip
[Minor] Improve logging for fann train
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/lua/fann_scores.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/plugins/lua/fann_scores.lua b/src/plugins/lua/fann_scores.lua
index 30f7a618b..6fc0112bc 100644
--- a/src/plugins/lua/fann_scores.lua
+++ b/src/plugins/lua/fann_scores.lua
@@ -432,9 +432,22 @@ local function fann_train_callback(score, required_score, results, cf, id, opts,
if not res then
rspamd_logger.errx(cf, 'cannot save fann in %s', fname)
else
+ data[id].exist = true
data[id].ntrains = 0
data[id].epoch = data[id].epoch + 1
end
+ else
+ if not data[id].checked then
+ data[id].checked = true
+ local err,st = rspamd_util.stat(fname)
+ if err then
+ data[id].exist = false
+ end
+ end
+ if not data[id].exist then
+ rspamd_logger.infox(cf, 'not enough trains for fann %s, %s left', fname,
+ max_trains - data[id].ntrains)
+ end
end
if data[id].epoch > max_epoch then