fix: added conditional check for the unkey logger to reduce the number of logs (#25858)

This commit is contained in:
an_ifrah24 authored and GitHub committed 2025-12-14 12:35:57 +00:00
1 parent a8f43da472
commit 550caa6665
1 file changed
+6 -1
+6 -1
View File
@@ -28,11 +28,16 @@ export type RateLimitHelper = {
export const API_KEY_RATE_LIMIT = 30;
let warned = false;
export function rateLimiter() {
const { UNKEY_ROOT_KEY } = process.env;
if (!UNKEY_ROOT_KEY) {
log.warn("Disabled because the UNKEY_ROOT_KEY environment variable was not found.");
if (!warned) {
log.warn("Disabled because the UNKEY_ROOT_KEY environment variable was not found.");
warned = true;
}
return () => ({ success: true, limit: 10, remaining: 999, reset: 0 } as RatelimitResponse);
}
const timeout = {