Redis client
Redis SET test_key test value
${result} = Scan Message With Rspamc ${MESSAGE}
- Check Rspamc ${result} REDIS (0.00)[hello from lua on redis]
Check Rspamc ${result} REDIS_ASYNC (0.00)[test value]
Check Rspamc ${result} REDIS_ASYNC201809 (0.00)[test value]
-- Just a test for Redis API
--]]
-local logger = require "rspamd_logger"
local redis_lua = require "lua_redis"
local redis_params
local N = 'redis_test'
-local lua_script = [[
-local f = function() end
-return "hello from lua on redis"
-]]
-
local function redis_simple_async_symbol(task)
local function redis_cb(err, data)
if err then
end
redis_lua.rspamd_redis_make_request(
- task,
+ task,
redis_params,
"test_key",
false,
redis_cb,
- 'GET',
+ 'GET',
{'test_key'}
)
end
callback = redis_cb
}
local request = {
- 'GET',
+ 'GET',
'test_key'
}
redis_lua.request(redis_params, attrs, request)
end
-
+--[[
local function redis_symbol(task)
local attrs = {task = task}
task:insert_result('REDIS', 1.0, data)
end
-
+--]]
redis_params = rspamd_parse_redis_server(N)
rspamd_config:register_symbol({
callback = redis_simple_async_api201809,
no_squeeze = true
})
-
+--[[
rspamd_config:register_symbol({
name = 'REDIS_TEST',
score = 1.0,
port = 18080,
})
end
-
+--[[
local function http_simple_tcp_symbol(task)
logger.errx(task, 'connect_sync, before')
end
logger.errx(task, '(is_ok: %1) content [%2 bytes] %3', is_ok, content_length, content)
end
-
+--]]
rspamd_config:register_symbol({
name = 'SIMPLE_TCP_ASYNC_TEST',
score = 1.0,