Skip to content

Commit

Permalink
Force rate limiting of certain domains
Browse files Browse the repository at this point in the history
  • Loading branch information
tombeynon committed May 27, 2024
1 parent 01b259b commit 3075514
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions status/healthMonitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ function HealthMonitor() {
}
}
}
const RATE_LIMITED_DOMAINS = ['publicnode.com', 'pupmos.network']
const hostname = new URL(finalAddress).hostname
// Partial match hostname to avoid rate limiting
if(RATE_LIMITED_DOMAINS.some(domain => hostname.includes(domain))){
rateLimitedAt = Date.now()
}
rateLimited = rateLimitedAt && rateLimitedAt > Date.now() - 1000 * RATE_LIMIT_COOLDOWN

let nowAvailable = false;
Expand Down

0 comments on commit 3075514

Please sign in to comment.