monkeyDluffy6017 commented on code in PR #9185:
URL: https://github.com/apache/apisix/pull/9185#discussion_r1159842300


##########
apisix/plugins/limit-count/limit-count-redis.lua:
##########
@@ -53,7 +58,12 @@ local function redis_cli(conf)
     count, err = red:get_reused_times()
     if 0 == count then
         if conf.redis_password and conf.redis_password ~= '' then
-            local ok, err = red:auth(conf.redis_password)
+            local ok, err
+            if conf.redis_username and conf.redis_username ~= '' then

Review Comment:
   if we check like below with `minLength = 1`,  Is it unnecessary to judge if 
redis_username is empty?
   ```
   redis_username = {
                   type = "string", minLength = 1,
   ```



##########
apisix/plugins/limit-count/limit-count-redis.lua:
##########
@@ -53,7 +58,12 @@ local function redis_cli(conf)
     count, err = red:get_reused_times()
     if 0 == count then
         if conf.redis_password and conf.redis_password ~= '' then
-            local ok, err = red:auth(conf.redis_password)
+            local ok, err
+            if conf.redis_username and conf.redis_username ~= '' then

Review Comment:
   if we check like below with `minLength = 1`,  Is it unnecessary to validate 
if redis_username is empty?
   ```
   redis_username = {
                   type = "string", minLength = 1,
   ```



-- 
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]

Reply via email to