Skip to content

Commit

Permalink
[fix]
Browse files Browse the repository at this point in the history
fix typos in README and worker functions
  • Loading branch information
Stephen Chen (ManPower) committed Aug 17, 2018
1 parent ee765ad commit 8b86cbb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,25 @@
"windowMs": "900000", // Time windows in ms, 900000ms = 15*60*1000ms = 15 minutes.
"max": "10", // Maximum requests allowed in the given time window.
"delayMs": "0",
"message": "Too many accounts created from this IP, please try again after 15 minutes" // Message to send when maximum requests reached.
"message": "Too many requests sent from this IP, please try again after 15 minutes" // Message to send when maximum requests reached.
},
"blockLimit":{ // This is the configuration of API rate limit for get block.
"windowMs": "900000",
"max": "10",
"delayMs": "0",
"message": "Too many accounts created from this IP, please try again after 15 minutes"
"message": "Too many requests sent from this IP, please try again after 15 minutes"
},
"transactionLimit":{ // This is the configuration of API rate limit for get transaction or send transaction.
"windowMs": "900000",
"max": "10",
"delayMs": "0",
"message": "Too many accounts created from this IP, please try again after 15 minutes"
"message": "Too many requests sent from this IP, please try again after 15 minutes"
},
"minerLimit":{ // This is the configuration of API rate limit for start miner or stop miner.
"windowMs": "900000",
"max": "10",
"delayMs": "0",
"message": "Too many accounts created from this IP, please try again after 15 minutes"
"message": "Too many requests sent from this IP, please try again after 15 minutes"
}
"worker":{
"minWorkers": 1,
Expand Down
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ function validateWorker(worker){
if(!lodash.isObject(worker)){
return false;
}
if(!worker.hasOwnProperty('minWorkers') || !lodash.isNumber(limit.minWorkers)){
if(!worker.hasOwnProperty('minWorkers') || !lodash.isNumber(worker.minWorkers)){
return false;
}
if(!worker.hasOwnProperty('maxWorkers') || !lodash.isNumber(limit.maxWorkers)){
if(!worker.hasOwnProperty('maxWorkers') || !lodash.isNumber(worker.maxWorkers)){
return false;
}
return true;
Expand All @@ -83,7 +83,7 @@ function validateConfiguration() {
if(!config.hasOwnProperty('minerLimit') || !validateRateLimit(config.minerLimit)){
config.minerLimit = defaultLimit;
}
if(!config.hasOwnProperty('worker') || !validateRateLimit(config.worker)){
if(!config.hasOwnProperty('worker') || !validateWorker(config.worker)){
config.worker = defaultWorker;
}
}
Expand Down

0 comments on commit 8b86cbb

Please sign in to comment.