File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
lib/api/apiUtils/rateLimit Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -67,12 +67,12 @@ class RateLimitClient {
6767 }
6868}
6969
70- let counterClient ;
70+ let instance ;
7171if ( config . rateLimiting . enabled ) {
72- counterClient = new RateLimitClient ( config . localCache ) ;
72+ instance = new RateLimitClient ( config . localCache ) ;
7373}
7474
7575module . exports = {
76- counterClient ,
76+ instance ,
7777 RateLimitClient
7878} ;
Original file line number Diff line number Diff line change 1+ -- updateCounter <KEY> <COST>
2+ --
3+ -- Adds the passed COST to the GCRA counter at KEY.
4+ -- If no counter currently exists a new one is created from the current time.
5+ -- The key expiration is set to the updated value.
6+ -- Returns the value of the updated key.
7+
18local ts = redis .call (' TIME' )
29local currentTime = ts [1 ] * 1000
310currentTime = currentTime + math.floor (ts [2 ] / 1000 )
You can’t perform that action at this time.
0 commit comments