From: Vsevolod Stakhov Date: Fri, 16 Sep 2016 11:18:04 +0000 (+0100) Subject: [Minor] Improve logging for fann train X-Git-Tag: 1.4.0~421 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b7de5d08121dce7e97db3b383ce0f8124fe7ff24;p=thirdparty%2Frspamd.git [Minor] Improve logging for fann train --- 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