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 2022/11/23 05:35:18 UTC

[GitHub] [apisix] spacewander commented on a diff in pull request #8379: refactor(consumer): expose create_consume_cache so that we can preprocess the consumer conf

spacewander commented on code in PR #8379:
URL: https://github.com/apache/apisix/pull/8379#discussion_r1030034730


##########
apisix/consumer.lua:
##########
@@ -94,6 +97,26 @@ function _M.consumers()
 end
 
 
+local function create_consume_cache(consumers_conf, key_attr, consumer_names)
+    core.table.clear(consumer_names)
+
+    for _, consumer in ipairs(consumers_conf.nodes) do
+        core.log.info("consumer node: ", core.json.delay_encode(consumer))
+        consumer_names[consumer.auth_conf[key_attr]] = consumer
+    end
+
+    return consumer_names
+end
+
+
+function _M.consumers_kv(plugin_name, consumer_conf, key_attr, consumer_names)

Review Comment:
   Why do we need to pass a consumer_names and fill it?



-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org