nic-6443 commented on code in PR #12872:
URL: https://github.com/apache/apisix/pull/12872#discussion_r2674736474


##########
apisix/plugins/limit-req/util.lua:
##########
@@ -68,6 +68,10 @@ function _M.incoming(self, red, key, commit)
         if not ok then
             return nil, err
         end
+
+        local ttl = math.ceil(self.burst / self.rate) + 1
+        red:expire(excess_key, ttl)
+        red:expire(last_key, ttl)

Review Comment:
   and can we set ttl by `redis:set` api directly? otherwise we introduce 
another two redis calls per request now.



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