Skip to content

Commit

Permalink
Rename exported to be more explicit
Browse files Browse the repository at this point in the history
  • Loading branch information
lingfish committed Aug 15, 2023
1 parent 2e6a452 commit 29031d7
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/plugins/lua/metadata_exporter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -357,10 +357,10 @@ local pushers = {
timeout = rule.timeout or settings.timeout,
}, formatted, sendmail_cb)
end,
json_raw = function(task, formatted, rule)
local function json_raw_callback(err, code)
json_raw_tcp = function(task, formatted, rule)
local function json_raw_tcp_callback(err, code)
if err then
rspamd_logger.errx(task, 'got error %s in json_raw callback', err)
rspamd_logger.errx(task, 'got error %s in json_raw_tcp callback', err)
return maybe_defer(task, rule)
end
return true
Expand All @@ -370,7 +370,7 @@ local pushers = {
host=rule.host,
port=rule.port,
data=formatted,
callback=json_raw_callback,
callback=json_raw_tcp_callback,
read=false,
})
end,
Expand Down Expand Up @@ -552,18 +552,18 @@ if type(settings.rules) ~= 'table' then
settings.rules[r.backend:upper()] = r
end
end
if settings.pusher_enabled.json_raw then
if settings.pusher_enabled.json_raw_tcp then
if not (settings.host and settings.port) then
rspamd_logger.errx(rspamd_config, 'No host and/or port is specified')
settings.pusher_enabled.json_raw = nil
settings.pusher_enabled.json_raw_tcp = nil
else
local r = {}
r.backend = 'json_raw'
r.backend = 'json_raw_tcp'
r.host = settings.host
r.port = settings.port
r.defer = settings.defer
r.selector = settings.pusher_select.json_raw
r.formatter = settings.pusher_format.json_raw
r.selector = settings.pusher_select.json_raw_tcp
r.formatter = settings.pusher_format.json_raw_tcp
settings.rules[r.backend:upper()] = r
end
end
Expand All @@ -590,7 +590,7 @@ local backend_required_elements = {
redis_pubsub = {
'channel',
},
json_raw = {
json_raw_tcp = {
'host',
'port',
},
Expand Down

0 comments on commit 29031d7

Please sign in to comment.