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 2020/10/17 07:35:47 UTC

[GitHub] [apisix] Firstsawyou opened a new issue #2448: chore: `limit-req` plugin code optimization

Firstsawyou opened a new issue #2448:
URL: https://github.com/apache/apisix/issues/2448


   ### Issue description
   
   This part of the code ( https://github.com/apache/apisix/blob/master/apisix/plugins/limit-req.lua#L70-L80)
    can be replaced with "`local key = (ctx.var[conf.key] or "") .. ctx.conf_type .. ctx.conf_version`" .
   
   
   


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

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



[GitHub] [apisix] membphis commented on issue #2448: chore: `limit-req` plugin code optimization

Posted by GitBox <gi...@apache.org>.
membphis commented on issue #2448:
URL: https://github.com/apache/apisix/issues/2448#issuecomment-715660673


   > That means that i don't need to restart to define key,i can directly use original way to accomplish my demand;But other plugins,just like limit-conn and limit-count ,is ok?
   
   the defined key is a `whitelist`, we need to enable it first.
   
   and then we can use `service_id` or `consumer_id`.
   
   the current code style, we can remove those, they are useless now. 
   https://github.com/apache/apisix/blob/master/apisix/plugins/limit-req.lua#L71-L78


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

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



[GitHub] [apisix] spacewander closed issue #2448: chore: `limit-req` plugin code optimization

Posted by GitBox <gi...@apache.org>.
spacewander closed issue #2448:
URL: https://github.com/apache/apisix/issues/2448


   


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



[GitHub] [apisix] LY-GO commented on issue #2448: chore: `limit-req` plugin code optimization

Posted by GitBox <gi...@apache.org>.
LY-GO commented on issue #2448:
URL: https://github.com/apache/apisix/issues/2448#issuecomment-714370571


   > ### Issue description
   > This part of the code ( https://github.com/apache/apisix/blob/master/apisix/plugins/limit-req.lua#L70-L80)
   > can be replaced with "`local key = (ctx.var[conf.key] or "") .. ctx.conf_type .. ctx.conf_version`" .
   If i want to use service_name to limit,i just modify key;just like so
   ![service-name](https://user-images.githubusercontent.com/67543312/96854379-ff3c0580-148d-11eb-9ebf-4d13a4765f94.png)
   
   


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

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



[GitHub] [apisix] LY-GO commented on issue #2448: chore: `limit-req` plugin code optimization

Posted by GitBox <gi...@apache.org>.
LY-GO commented on issue #2448:
URL: https://github.com/apache/apisix/issues/2448#issuecomment-715411449


   > > with "`local key = (ctx.var[conf.key] or "") .. ctx.conf_type .. ctx.conf_version`" .
   > 
   > this style can support `service_id` and `consumer_id` at the same time. @LY-GO
   That means that i don't need to restart to  define key,i can directly use original way to accomplish my demand;But other plugins,just like limit-conn and limit-count ,is ok? 
   
   


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

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



[GitHub] [apisix] membphis commented on issue #2448: chore: `limit-req` plugin code optimization

Posted by GitBox <gi...@apache.org>.
membphis commented on issue #2448:
URL: https://github.com/apache/apisix/issues/2448#issuecomment-715394567


   > with "`local key = (ctx.var[conf.key] or "") .. ctx.conf_type .. ctx.conf_version`" .
   
   this style can support `service_id` and `consumer_id` at the same time. @LY-GO 


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

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