commit f2237ce: [Minor] Fix settings id display

Vsevolod Stakhov vsevolod at highsecure.ru
Tue Jul 30 18:49:03 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-07-30 19:43:58 +0100
URL: https://github.com/rspamd/rspamd/commit/f2237ce39686967e00abb8886d21687fd22c5682 (HEAD -> master)

[Minor] Fix settings id display

---
 src/plugins/lua/settings.lua | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/plugins/lua/settings.lua b/src/plugins/lua/settings.lua
index 54bfcd47d..f8b12b086 100644
--- a/src/plugins/lua/settings.lua
+++ b/src/plugins/lua/settings.lua
@@ -145,10 +145,10 @@ local function check_query_settings(task)
   end
 
   if settings_id and settings_initialized then
-    local elt = lua_settings.settings_by_id(settings_id)
+    local cached = lua_settings.settings_by_id(settings_id)
 
-    if elt then
-      elt = elt.settings
+    if cached then
+      local elt = cached.settings
       if elt['whitelist'] then
         elt['apply'] = {whitelist = true}
       end
@@ -158,8 +158,8 @@ local function check_query_settings(task)
           elt.apply = lua_util.override_defaults(nset, elt.apply)
         end
         apply_settings(task, elt['apply'], settings_id)
-        rspamd_logger.infox(task, "applied settings id %s(%s)", settings_id,
-            elt.name)
+        rspamd_logger.infox(task, "applied settings id %s(%s)",
+            cached.name, settings_id)
         return true
       end
     else


More information about the Commits mailing list