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


##########
apisix/plugins/limit-req.lua:
##########
@@ -68,8 +104,23 @@ end
 
 
 local function create_limit_obj(conf)
-    core.log.info("create new limit-req plugin instance")
-    return limit_req_new("plugin-limit-req", conf.rate, conf.burst)
+    if conf.policy == "local" then
+        core.log.info("create new limit-req plugin instance")
+        return limit_req_new("plugin-limit-req", conf.rate, conf.burst)
+    elseif conf.policy == "redis" then
+

Review Comment:
   I think it should like this 
   ```
       if conf.policy == "local" then
           core.log.info("create new limit-req plugin instance")
           return limit_req_new("plugin-limit-req", conf.rate, conf.burst)
   
       elseif conf.policy == "redis" then
           core.log.info("create new limit-req redis plugin instance")
           return redis_single_new("plugin-limit-req", conf, conf.rate, 
conf.burst)
   
       elseif conf.policy == "redis-cluster" then
           core.log.info("create new limit-req redis-cluster plugin instance")
           return redis_cluster_new("plugin-limit-req", conf, conf.rate, 
conf.burst)
       
   ```



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