You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/11/03 14:10:52 UTC

[GitHub] [apisix] membphis commented on a change in pull request #2575: change: make lrucache lock optional

membphis commented on a change in pull request #2575:
URL: https://github.com/apache/apisix/pull/2575#discussion_r515770469



##########
File path: apisix/core/lrucache.lua
##########
@@ -125,42 +139,37 @@ end
 global_lru_fun = new_lru_fun()
 
 
-local function _plugin(plugin_name, key, version, create_obj_fun, ...)
-    local lru_global = global_lru_fun("/plugin/" .. plugin_name, nil,
-                                      lru_new, PLUGIN_ITEMS_COUNT)
-
-    local obj, stale_obj = lru_global:get(key)
-    if obj and obj.ver == version then
-        return obj.val
-    end
-
-    if stale_obj and stale_obj.ver == version then
-        lru_global:set(key, stale_obj, PLUGIN_TTL)
-        return stale_obj
-    end
+local plugin_ctx
+do
+    local key_buf = {
+        nil,
+        nil,
+        nil,
+    }
+
+    function plugin_ctx(lrucache, api_ctx, extra_key, create_obj_fun, ...)

Review comment:
       `create_obj_fun` -> `create_obj_func`




----------------------------------------------------------------
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:
users@infra.apache.org