diff options
author | Andrew Lewis <nerf@judo.za.org> | 2016-11-04 18:30:00 +0200 |
---|---|---|
committer | Andrew Lewis <nerf@judo.za.org> | 2016-11-04 18:30:00 +0200 |
commit | ef834351aeca4bf4c1755347692f559c6b0cc267 (patch) | |
tree | 38c379473bb712e6f5cb00e1a5d2356d43f62d41 /src/plugins/lua/mx_check.lua | |
parent | 057462c67dd333292ca70c5b4a2a31eeb04c735c (diff) | |
download | rspamd-ef834351aeca4bf4c1755347692f559c6b0cc267.tar.gz rspamd-ef834351aeca4bf4c1755347692f559c6b0cc267.zip |
[Minor] Remove more globals
Diffstat (limited to 'src/plugins/lua/mx_check.lua')
-rw-r--r-- | src/plugins/lua/mx_check.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/lua/mx_check.lua b/src/plugins/lua/mx_check.lua index be13a1322..3e4f23a58 100644 --- a/src/plugins/lua/mx_check.lua +++ b/src/plugins/lua/mx_check.lua @@ -19,7 +19,7 @@ local rspamd_logger = require "rspamd_logger" local rspamd_tcp = require "rspamd_tcp" local rspamd_redis = require "rspamd_redis" local rspamd_util = require "rspamd_util" -require "fun" () +local fun = require "fun" local settings = { timeout = 1.0, -- connect timeout @@ -58,7 +58,7 @@ local function mx_check(task) local valid = false local function check_results(mxes) - if all(function(k, elt) return elt.checked end, mxes) then + if fun.all(function(k, elt) return elt.checked end, mxes) then -- Save cache local key = settings.key_prefix .. mx_domain local function redis_cache_cb(err, data) @@ -88,9 +88,9 @@ local function mx_check(task) ) else local valid_mx = {} - each(function(k, mx) + fun.each(function(k, mx) table.insert(valid_mx, k) - end, filter(function (k, elt) return elt.working end, mxes)) + end, fun.filter(function (k, elt) return elt.working end, mxes)) task:insert_result(settings.symbol_good_mx, 1.0, valid_mx) local ret,_,_ = rspamd_redis_make_request(task, redis_params, -- connect params |