beardnick commented on code in PR #12751: URL: https://github.com/apache/apisix/pull/12751#discussion_r2553721593
########## 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) Review Comment: Yes, this is a better solution. -- 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]
