Skip to content

Commit

Permalink
Merge pull request #45 from eco-stake/enable-rate-limited-nodes-if-re…
Browse files Browse the repository at this point in the history
…quired

Allow rate limited nodes if required
  • Loading branch information
tombeynon committed Oct 7, 2022
2 parents db8759d + 617cd53 commit c523c54
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions chains/chainApis.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ function ChainApis(health) {

return el.lastErrorAt <= (bestErrors + BEST_ERROR_DIFF * 1000)
})
const withoutRateLimit = urls.filter(el => !el.rateLimited)
if(withoutRateLimit.length){
urls = withoutRateLimit
}
return urls.sort((a, b) => {
return a.responseTime - b.responseTime
})
Expand Down
2 changes: 1 addition & 1 deletion status/healthMonitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ function HealthMonitor() {
}

let nowAvailable = false;
if (errorCount <= ALLOWED_ERRORS && !rateLimited) {
if (errorCount <= ALLOWED_ERRORS) {
nowAvailable = !error || !!urlHealth.available;
}
if (available && !nowAvailable) {
Expand Down

0 comments on commit c523c54

Please sign in to comment.