Browse Source

[Fix] Unlock ANN on error

tags/1.4.0
Vsevolod Stakhov 7 years ago
parent
commit
a5eef8b08c
1 changed files with 8 additions and 0 deletions
  1. 8
    0
      src/plugins/lua/fann_redis.lua

+ 8
- 0
src/plugins/lua/fann_redis.lua View File

@@ -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


Loading…
Cancel
Save