From b7de5d08121dce7e97db3b383ce0f8124fe7ff24 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 16 Sep 2016 12:18:04 +0100 Subject: [PATCH] [Minor] Improve logging for fann train --- src/plugins/lua/fann_scores.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/plugins/lua/fann_scores.lua b/src/plugins/lua/fann_scores.lua index 30f7a618b2..6fc0112bc7 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 -- 2.47.3