membphis commented on code in PR #12413: URL: https://github.com/apache/apisix/pull/12413#discussion_r2196337693
########## apisix/consumer.lua: ########## @@ -159,17 +120,50 @@ function plugin_consumer() conf_version = consumers.conf_version } end - - local consumer = consumers_id_lrucache(val.value.id .. name, - val.modifiedIndex, construct_consumer_data, val, config) - if consumer == nil then - goto CONTINUE + -- if the val is a Consumer, clone it to the local consumer; + -- if the val is a Credential, to get the Consumer by consumer_name and then clone + -- it to the local consumer. + local consumer Review Comment: I don't prefer current code style, it not easy to read We can put those changing code to one or two seperate functions, and check the return value if it failed Reducing the nesting depth can make the code more readable. -- 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-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org