mscb402 commented on code in PR #8578:
URL: https://github.com/apache/apisix/pull/8578#discussion_r1058141023


##########
apisix/plugins/limit-count/init.lua:
##########
@@ -300,9 +327,28 @@ function _M.rate_limit(conf, ctx)
         return 500, {error_msg = "failed to limit count"}
     end
 
+    local reset
+    if remaining == conf.count - 1 then
+        -- set an end time
+        local end_time = ngx_time() + conf.time_window
+        -- save to lrucache by key
+        reset = conf.time_window
+        local end_time_obj = get_end_time(conf,key)

Review Comment:
   solution 1 does not work either. Because by default limit count will not use 
Redis as the backend. So we can't save it to Redis.



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