Skip to content

Scheduling infrastructure for absolutely everyone.

hotfix: unreachable rate limits

zomars154af1367a21
diff --git a/packages/lib/checkRateLimitAndThrowError.ts b/packages/lib/checkRateLimitAndThrowError.ts
index 88c43f0230a..d510a16181a 100644
--- a/packages/lib/checkRateLimitAndThrowError.ts
+++ b/packages/lib/checkRateLimitAndThrowError.ts
@@ -9,7 +9,7 @@ export async function checkRateLimitAndThrowError({
}: RateLimitHelper) {
const { remaining, reset } = await rateLimiter()({ rateLimitingType, identifier });
- if (remaining < 0) {
+ if (remaining < 1) {
const convertToSeconds = (ms: number) => Math.floor(ms / 1000);
const secondsToWait = convertToSeconds(reset - Date.now());
throw new TRPCError({