diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-11-15 16:41:35 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-11-15 16:41:35 +0000 |
commit | a5eef8b08ca4ea69cc3c5bb718102fe24f20a61b (patch) | |
tree | 486a07dba648f1167827915431e28e304576300c | |
parent | b36155bb4b3b911b6d53529dc415d13cff376d2d (diff) | |
download | rspamd-a5eef8b08ca4ea69cc3c5bb718102fe24f20a61b.tar.gz rspamd-a5eef8b08ca4ea69cc3c5bb718102fe24f20a61b.zip |
[Fix] Unlock ANN on error
-rw-r--r-- | src/plugins/lua/fann_redis.lua | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/plugins/lua/fann_redis.lua b/src/plugins/lua/fann_redis.lua index 3652f6724..cff8981de 100644 --- a/src/plugins/lua/fann_redis.lua +++ b/src/plugins/lua/fann_redis.lua @@ -400,6 +400,14 @@ local function train_fann(_, ev_base, elt) if err then rspamd_logger.errx(rspamd_config, 'cannot save ANN %s to redis: %s', fann_prefix .. elt, err) + redis_make_request(ev_base, + rspamd_config, + nil, + false, -- is write + redis_unlock_cb, --callback + 'DEL', -- command + {fann_prefix .. elt .. '_lock'} + ) end end |