local exports = {}
local E = {}
+local N = "lua_redis"
local common_schema = ts.shape {
timeout = (ts.number + ts.string / lutil.parse_time_interval):is_optional(),
if upstreams_write then
result.write_servers = upstreams_write
end
+
+ lutil.debugm(N, 'loaded redis server: %s', result)
return true
end
-- Try local options
local opts
+ lutil.debugm(N, rspamd_config, 'try load redis config for: %s', module_name)
if not module_opts then
opts = rspamd_config:get_all_opt(module_name)
else
options['dbname'] = redis_params['db']
end
+ lutil.debugm(N, task, 'perform request to redis server' ..
+ ' (host=%s, timeout=%s): cmd: %s, arguments: %s', ip_addr,
+ options.timeout, cmd, args)
+
local ret,conn = rspamd_redis.make_request(options)
if not ret then
options['dbname'] = redis_params['db']
end
+ lutil.debugm(N, config, 'perform taskless request to redis server' ..
+ ' (host=%s, timeout=%s): cmd: %s, arguments: %s', ip_addr,
+ options.timeout, cmd, args)
local ret,conn = rspamd_redis.make_request(options)
if not ret then
logger.errx('cannot execute redis request')
opts.dbname = redis_params.db
end
+ lutil.debugm(N, 'perform generic request to redis server' ..
+ ' (host=%s, timeout=%s): cmd: %s, arguments: %s', addr,
+ opts.timeout, opts.cmd, opts.args)
+
if opts.callback then
local ret,conn = rspamd_redis.make_request(opts)
if not ret then