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


##########
apisix/plugins/limit-count/limit-count-redis-cluster.lua:
##########
@@ -57,26 +47,33 @@ function _M.new(plugin_name, limit, window, conf)
 end
 
 
-function _M.incoming(self, key, cost)
-    local red = self.red_cli
-    local limit = self.limit
-    local window = self.window
-    key = self.plugin_name .. tostring(key)
+function _M.incoming(self, key, cost, dry_run)
+    local commit = true
+    if dry_run ~= nil then
+        commit = not dry_run
+    end
 
-    local ttl = 0
-    local res, err = red:eval(script, 1, key, limit, window, cost or 1)
+    return util.redis_incoming(self, self.red_cli, key, commit, cost)
+end
 
-    if err then
-        return nil, err, ttl
-    end
 
-    local remaining = res[1]
-    ttl = res[2]
+local function log_phase_incoming_thread(premature, self, key, cost)

Review Comment:
   This code should be placed in the ai-rate-limiting plugin, not in the 
limit-count plugin itself, because this code is only useful for 
ai-rate-limiting.



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