Fix all compliance violations

This commit is contained in:
gpt-engineer-app[bot]
2025-11-03 18:38:46 +00:00
parent 7eb0b77d76
commit 6efb6dda66
6 changed files with 60 additions and 40 deletions

View File

@@ -62,17 +62,13 @@ class RateLimiter {
}
}
if (deletedCount > 0) {
console.log(`[RateLimit] Cleaned ${deletedCount} expired entries`);
}
// Cleanup runs silently unless there are issues
} catch (error) {
console.error('[RateLimit] Cleanup failed:', error);
// Emergency: Clear oldest 30% if cleanup fails
if (this.rateLimitMap.size > this.config.maxMapSize) {
const toClear = Math.floor(this.rateLimitMap.size * 0.3);
const keys = Array.from(this.rateLimitMap.keys()).slice(0, toClear);
keys.forEach(key => this.rateLimitMap.delete(key));
console.warn(`[RateLimit] Emergency cleared ${keys.length} entries`);
}
}
}