File tree Expand file tree Collapse file tree
lib/api/apiUtils/rateLimit
functional/aws-node-sdk/test/rateLimit
unit/api/apiUtils/rateLimit Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -60,9 +60,9 @@ class RateLimitClient {
6060 return ;
6161 }
6262
63- cb ( null , results . map ( ( [ _ , value ] , i ) => ( {
63+ cb ( null , results . map ( ( res , i ) => ( {
6464 key : batch [ i ] . key ,
65- value,
65+ value : res [ 1 ] ,
6666 } ) ) ) ;
6767 } ) ;
6868 }
@@ -76,4 +76,4 @@ if (config.rateLimiting.enabled) {
7676module . exports = {
7777 counterClient,
7878 RateLimitClient
79- }
79+ } ;
Original file line number Diff line number Diff line change @@ -32,11 +32,9 @@ describe('Test RateLimitClient', () => {
3232 const batch = [ { key : counterKey , cost : 10000 } ] ;
3333 client . updateLocalCounters ( batch , ( err , res ) => {
3434 assert . ifError ( err ) ;
35- console . log ( { res } ) ;
3635 const { value : existingValue } = res [ 0 ] ;
3736 client . updateLocalCounters ( batch , ( err , res ) => {
3837 assert . ifError ( err ) ;
39- console . log ( { res } ) ;
4038 const { value : newValue } = res [ 0 ] ;
4139 assert ( newValue > existingValue , `${ newValue } is not greater than ${ existingValue } ` ) ;
4240 done ( ) ;
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ const { RateLimitClient } = require('../../../../../lib/api/apiUtils/rateLimit/c
44
55class RedisStub {
66 constructor ( ) {
7- this . data = { }
7+ this . data = { } ;
88 }
99
1010 pipeline ( ) {
@@ -42,7 +42,7 @@ describe('test RateLimitClient', () => {
4242 { key : 'foo' , cost : 100 } ,
4343 { key : 'bar' , cost : 200 } ,
4444 { key : 'qux' , cost : 300 } ,
45- ]
45+ ] ;
4646
4747 client . updateLocalCounters ( batch , ( err , results ) => {
4848 assert . ifError ( err ) ;
You can’t perform that action at this time.
0 commit comments