mscb402 commented on code in PR #8578:
URL: https://github.com/apache/apisix/pull/8578#discussion_r1062274841
##########
apisix/plugins/limit-count/limit-count-redis.lua:
##########
@@ -85,27 +70,52 @@ function _M.incoming(self, key)
-- core.log.info(" err: ", err)
return nil, err
end
+ return red, nil
+end
+
+function _M.new(plugin_name, limit, window, conf)
+ assert(limit > 0 and window > 0)
+
+ local self = {
+ limit = limit,
+ window = window,
+ conf = conf,
+ plugin_name = plugin_name,
+ }
+ return setmetatable(self, mt)
+end
+
+function _M.incoming(self, key)
+ local conf = self.conf
+ local red, err = redis_cli(conf)
+ if err then
+ return red, err
Review Comment:
fixed
##########
apisix/plugins/limit-count/limit-count-redis.lua:
##########
@@ -85,27 +70,52 @@ function _M.incoming(self, key)
-- core.log.info(" err: ", err)
return nil, err
end
+ return red, nil
+end
+
+function _M.new(plugin_name, limit, window, conf)
+ assert(limit > 0 and window > 0)
+
+ local self = {
+ limit = limit,
+ window = window,
+ conf = conf,
+ plugin_name = plugin_name,
+ }
+ return setmetatable(self, mt)
+end
+
+function _M.incoming(self, key)
+ local conf = self.conf
+ local red, err = redis_cli(conf)
+ if err then
Review Comment:
fixed
--
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]