Skip to content

Commit

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

Expand Down

0 comments on commit e412914

Please sign in to comment.