shreemaan-abhishek commented on code in PR #12872:
URL: https://github.com/apache/apisix/pull/12872#discussion_r2680886189


##########
apisix/plugins/limit-conn/util.lua:
##########
@@ -28,9 +28,20 @@ function _M.incoming(self, red, key, commit)
 
     local conn, err
     if commit then
-        conn, err = red:incrby(key, 1)
-        if not conn then
-            return nil, err
+        if self.conf.key_ttl then
+            red:init_pipeline()

Review Comment:
   Unlike `limit-req`, `limit-conn` uses `incrby`, and `incrby` does not 
support passing an `expiry` parameter.
   
   Using redis pipeline to perform incrby and expire over a single call instead 
of two different incrby and expire calls is more performant.
   
   > •limit-req: Uses the atomic SET ... EX command.
   
   



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