membphis commented on code in PR #11840:
URL: https://github.com/apache/apisix/pull/11840#discussion_r1926692216
##########
apisix/consumer.lua:
##########
@@ -80,7 +85,53 @@ local function filter_consumers_list(data_list)
return list
end
-local function plugin_consumer()
+local plugin_consumer
+do
+ local consumers_id_lrucache = core.lrucache.new({
+ count = consumers_count_for_lrucache
Review Comment:
we can add some comments, tell the other developers how to use this variable
##########
apisix/consumer.lua:
##########
@@ -186,20 +215,33 @@ function _M.consumers()
end
-local function create_consume_cache(consumers_conf, key_attr)
+local create_consume_cache
+do
+ local consumer_lrucache = core.lrucache.new({
+ count = consumers_count_for_lrucache
+ })
+
+local function fill_consumer_secret(consumer)
+ consumer.auth_conf = secret.fetch_secrets(consumer.auth_conf, false)
Review Comment:
it is not safe to update the original `consumer` object.
more safe way:
```lua
local new_consumer = table.clone(consumer)
new_consumer.auth_conf = secret.fetch_secrets(consumer.auth_conf, false)
return new_consumer
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]