Merge pull request #130 from Permissionless-Software-Foundation/ct-unstable

fix(rate limits): Making internal rate limits an env var
This commit is contained in:
Chris Troutner
2021-04-20 16:01:45 -07:00
committed by GitHub
3 changed files with 5 additions and 2 deletions
+3
View File
@@ -16,6 +16,9 @@ const config = {
whitelistRateLimit: process.env.WHITELIST_RATE_LIMIT whitelistRateLimit: process.env.WHITELIST_RATE_LIMIT
? Number(process.env.WHITELIST_RATE_LIMIT) ? Number(process.env.WHITELIST_RATE_LIMIT)
: 10, : 10,
internalRateLimit: process.env.INTERNAL_RATE_LIMIT
? Number(process.env.INTERNAL_RATE_LIMIT)
: 10,
pointsPerMinute: process.env.POINTS_PER_MINUTE pointsPerMinute: process.env.POINTS_PER_MINUTE
? Number(process.env.POINTS_PER_MINUTE) ? Number(process.env.POINTS_PER_MINUTE)
: 10000, : 10000,
+1 -1
View File
@@ -16,7 +16,7 @@
"dev": "nodemon ./dist/app.js", "dev": "nodemon ./dist/app.js",
"test": "npm run lint && npm run test-v4", "test": "npm run lint && npm run test-v4",
"lint": "standard --env mocha --fix", "lint": "standard --env mocha --fix",
"test-v4": "export NETWORK=mainnet && nyc --reporter=text mocha --timeout 60000 test/v4/", "test-v4": "export NETWORK=mainnet && nyc --reporter=text mocha --exit --timeout 60000 test/v4/",
"test:integration": "mocha test/v4/integration", "test:integration": "mocha test/v4/integration",
"test:integration:slpdb": "mocha --timeout 25000 -g '#validate2Single' test/v4/integration/slp*.js", "test:integration:slpdb": "mocha --timeout 25000 -g '#validate2Single' test/v4/integration/slp*.js",
"coverage": "nyc report --reporter=text-lcov | coveralls", "coverage": "nyc report --reporter=text-lcov | coveralls",
+1 -1
View File
@@ -56,7 +56,7 @@ const ANON_LIMITS = config.anonRateLimit
const WHITELIST_DOMAINS = config.whitelistDomains const WHITELIST_DOMAINS = config.whitelistDomains
const WHITELIST_POINTS_TO_CONSUME = config.whitelistRateLimit const WHITELIST_POINTS_TO_CONSUME = config.whitelistRateLimit
const POINTS_PER_MINUTE = config.pointsPerMinute const POINTS_PER_MINUTE = config.pointsPerMinute
const INTERNAL_POINTS_TO_CONSUME = 10 const INTERNAL_POINTS_TO_CONSUME = config.internalRateLimit
class RateLimits { class RateLimits {
constructor () { constructor () {