starsz commented on a change in pull request #2566:
URL: https://github.com/apache/apisix/pull/2566#discussion_r514788575



##########
File path: apisix/plugins/hmac-auth.lua
##########
@@ -328,7 +312,7 @@ local function get_params(ctx)
     local date_key = DATE_KEY
     local signed_headers_key = SIGNED_HEADERS_KEY
 
-    if try_attr(local_conf, "plugin_attr", "hmac-auth") then
+    if core.table.try_read_attr(local_conf, "plugin_attr", "hmac-auth") then
         local attr = local_conf.plugin_attr["hmac-auth"]

Review comment:
       OK. I had fixed.

##########
File path: apisix/plugins/log-rotate.lua
##########
@@ -152,25 +150,11 @@ local function scan_log_folder()
 end
 
 
-local function try_attr(t, ...)
-    local count = select('#', ...)
-    for i = 1, count do
-        local attr = select(i, ...)
-        t = t[attr]
-        if type(t) ~= "table" then
-            return false
-        end
-    end
-
-    return true
-end
-
-
 local function rotate()
     local local_conf = core.config.local_conf()
     local interval = INTERVAL
     local max_kept = MAX_KEPT
-    if try_attr(local_conf, "plugin_attr", "log-rotate") then
+    if core.table.try_read_attr(local_conf, "plugin_attr", "log-rotate") then
         local attr = local_conf.plugin_attr["log-rotate"]

Review comment:
       OK. I had fixed.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to