diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-02-19 16:19:18 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-02-19 16:19:18 +0000 |
commit | 98fc96ac699fd75eeb650e04a30649a5d582dfa9 (patch) | |
tree | c6f457b16f3c93221c452c460f8ee06ddf54ec41 /lualib/lua_redis.lua | |
parent | 628b69c39b99817bb5bb694e4e9dead659e58caf (diff) | |
download | rspamd-98fc96ac699fd75eeb650e04a30649a5d582dfa9.tar.gz rspamd-98fc96ac699fd75eeb650e04a30649a5d582dfa9.zip |
[Minor] Add more logging about Redis errors
Diffstat (limited to 'lualib/lua_redis.lua')
-rw-r--r-- | lualib/lua_redis.lua | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/lualib/lua_redis.lua b/lualib/lua_redis.lua index 1ab876109..c01cdfae9 100644 --- a/lualib/lua_redis.lua +++ b/lualib/lua_redis.lua @@ -710,11 +710,14 @@ local function load_script_task(script, task) opt.task = task opt.callback = function(err, data) if err then + logger.errx(task, 'cannot upload script to %s: %s', + opt.upstream:get_addr(), err) opt.upstream:fail() else opt.upstream:ok() logger.infox(task, - "loaded redis script with id %s, sha: %s", script.id, data) + "uploaded redis script to %s with id %s, sha: %s", + opt.upstream:get_addr(), script.id, data) script.sha = data -- We assume that sha is the same on all servers end script.in_flight = script.in_flight - 1 @@ -727,7 +730,8 @@ local function load_script_task(script, task) local ret = rspamd_redis.make_request(opt) if not ret then - logger.errx('cannot execute redis request to load script') + logger.errx('cannot execute redis request to load script on %s', + opt.upstream:get_addr()) script.in_flight = script.in_flight - 1 opt.upstream:fail() end @@ -747,11 +751,14 @@ local function load_script_taskless(script, cfg, ev_base) opt.ev_base = ev_base opt.callback = function(err, data) if err then + logger.errx(cfg, 'cannot upload script to %s: %s', + opt.upstream:get_addr(), err) opt.upstream:fail() else opt.upstream:ok() logger.infox(cfg, - "loaded redis script with id %s, sha: %s", script.id, data) + "uploaded redis script to %s with id %s, sha: %s", + opt.upstream:get_addr(), script.id, data) script.sha = data -- We assume that sha is the same on all servers end script.in_flight = script.in_flight - 1 @@ -763,7 +770,8 @@ local function load_script_taskless(script, cfg, ev_base) local ret = rspamd_redis.make_request(opt) if not ret then - logger.errx('cannot execute redis request to load script') + logger.errx('cannot execute redis request to load script on %s', + opt.upstream:get_addr()) script.in_flight = script.in_flight - 1 opt.upstream:fail() end |