From: Vsevolod Stakhov Date: Mon, 16 Apr 2018 16:52:15 +0000 (+0100) Subject: [Minor] Cache hostname value X-Git-Tag: 1.7.4~89 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=190530179aa87127ffd6980b86bc58a52a1286ad;p=rspamd.git [Minor] Cache hostname value --- diff --git a/lualib/lua_auth_results.lua b/lualib/lua_auth_results.lua index fcde73e0a..e8808d842 100644 --- a/lualib/lua_auth_results.lua +++ b/lualib/lua_auth_results.lua @@ -55,6 +55,7 @@ local default_settings = { } local exports = {} +local local_hostname = rspamd_util.get_hostname() local function gen_auth_results(task, settings) local table = table @@ -77,9 +78,9 @@ local function gen_auth_results(task, settings) symbols = {} } - local hostname = rspamd_util.get_hostname() - if hostname then - table.insert(hdr_parts, hostname) + + if local_hostname then + table.insert(hdr_parts, local_hostname) end for auth_type, symbols in pairs(auth_types) do