aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/lua/fann_scores.lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-04-28 18:52:36 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-04-28 18:52:36 +0100
commita8c39008921156163832087cf12b2d0684f4ba6f (patch)
tree023abd65b38423aad59fbeae31bc779071245970 /src/plugins/lua/fann_scores.lua
parent46a9c398ef7aa011d532bfc159c85efa289bdd1e (diff)
downloadrspamd-a8c39008921156163832087cf12b2d0684f4ba6f.tar.gz
rspamd-a8c39008921156163832087cf12b2d0684f4ba6f.zip
[Fix] Fix fann rewrite
Diffstat (limited to 'src/plugins/lua/fann_scores.lua')
-rw-r--r--src/plugins/lua/fann_scores.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/lua/fann_scores.lua b/src/plugins/lua/fann_scores.lua
index e72c1d4d6..2a124f019 100644
--- a/src/plugins/lua/fann_scores.lua
+++ b/src/plugins/lua/fann_scores.lua
@@ -186,7 +186,8 @@ local function fann_train_callback(score, required_score,results, cf, id, opts)
-- Store fann on disk
local res = false
- if not rspamd_util.stat(fname) then
+ local err,st = rspamd_util.stat(fname)
+ if not err then
local fd,err = rspamd_util.create_file(fname)
if not fd then
rspamd_logger.errx(cf, 'cannot save fann in %s: %s', fname, err)