File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed 
lib/api/apiUtils/rateLimit Expand file tree Collapse file tree 2 files changed +9
-2
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 )  { 
7272    counterClient  =  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