Skip to content

Commit

Permalink
upped balance rate limiting (#596)
Browse files Browse the repository at this point in the history
* upped balance rate limiting

* removed plugin from endpoint
  • Loading branch information
maikelmclauflin committed Mar 29, 2019
1 parent af58749 commit 696cef7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions balance/controllers/address.js
Expand Up @@ -7,6 +7,16 @@ const utils = require('bat-utils')
const braveHapi = utils.extras.hapi
const braveJoi = utils.extras.joi

const plugins = {
rateLimit: {
enabled: true,
rate: () => ({
limit: 60000,
window: 60
})
}
}

const expireIn = process.env.BALANCE_CACHE_TTL_S || 60 // 1 minute default
const expireSettings = {
EX: expireIn
Expand Down Expand Up @@ -149,6 +159,7 @@ v2.invalidateCardBalance =
reply({})
}
},
plugins,
description: 'Invalidate the cached balance of a ledger wallet',
tags: [ 'api' ],

Expand Down

0 comments on commit 696cef7

Please sign in to comment.