Skip to content

Commit

Permalink
Allow rate limited nodes if required
Browse files Browse the repository at this point in the history
  • Loading branch information
tombeynon committed Oct 7, 2022
1 parent db8759d commit 617cd53
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 617cd53

Please sign in to comment.