aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/lua/clickhouse.lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-12-22 18:24:39 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-12-22 18:24:39 +0000
commit0daddc29cab716e143d0c037b122774b67bff720 (patch)
tree885bb27ca09fe235ef5c284898f04ae19add15f0 /src/plugins/lua/clickhouse.lua
parent5d12d7827f3f526b85ac6da2757242de0f644fc8 (diff)
downloadrspamd-0daddc29cab716e143d0c037b122774b67bff720.tar.gz
rspamd-0daddc29cab716e143d0c037b122774b67bff720.zip
[Fix] Fix clickhouse exporter
Diffstat (limited to 'src/plugins/lua/clickhouse.lua')
-rw-r--r--src/plugins/lua/clickhouse.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/plugins/lua/clickhouse.lua b/src/plugins/lua/clickhouse.lua
index 84a479b46..aae6f20b7 100644
--- a/src/plugins/lua/clickhouse.lua
+++ b/src/plugins/lua/clickhouse.lua
@@ -250,12 +250,12 @@ end
local function clickhouse_send_data(task)
local upstream = settings.upstream:get_upstream_round_robin()
- local ip_addr = tostring(upstream:get_addr())
+ local ip_addr = upstream:get_addr():to_string(true)
local function http_cb(err_message, code, _, _)
if code ~= 200 or err_message then
- rspamd_logger.errx(task, "cannot send data to clickhouse server %s: %s:%s",
- ip_addr, code, err_message)
+ rspamd_logger.errx(task, "cannot send data to clickhouse server %s: %s",
+ ip_addr, err_message)
upstream:fail()
else
rspamd_logger.infox(task, "sent %s rows to clickhouse server %s",
@@ -688,12 +688,12 @@ if opts then
rspamd_config:add_on_load(function(cfg, ev_base, worker)
-- XXX: need to call this script for all upstreams
local upstream = settings.upstream:get_upstream_round_robin()
- local ip_addr = tostring(upstream:get_addr())
+ local ip_addr = upstream:get_addr():to_string(true)
local function http_cb(err_message, code, _, _)
if code ~= 200 or err_message then
- rspamd_logger.errx(rspamd_config, "cannot create table in clickhouse server %s: %s:%s",
- ip_addr, code, err_message)
+ rspamd_logger.errx(rspamd_config, "cannot create table in clickhouse server %s: %s",
+ ip_addr, err_message)
upstream:fail()
else
upstream:ok()