fix: healthcheck draining youtube api
Build and Push Image / build-backend (push) Successful in 2m36s
Build and Push Image / build-frontend (push) Successful in 3m54s
Build and Push Image / push (push) Successful in 1m4s

This commit is contained in:
2026-07-29 08:42:26 +07:00 Unverified
parent 4d0f459bdb
commit 81ae89f216
4 changed files with 65 additions and 11 deletions
+14
View File
@@ -85,6 +85,20 @@ export class AdaptiveCache {
for (const [key, value] of this.cache)
if (value.expires <= now) this.cache.delete(key);
}
debugStats() {
const projected =
this.requests.length * (this.options.period / this.options.lookback!);
return [
`AdaptiveCache`,
this.shouldCache() ? "HOT" : "COLD",
`recent=${this.requests.length}`,
`projected=${projected.toFixed(1)}/${this.options.maxRequests}`,
`usage=${((projected / this.options.maxRequests) * 100).toFixed(0)}%`,
`entries=${this.cache.size}`,
].join(" | ");
}
}
export const youtubeCache = new AdaptiveCache({