hotfix: unreachable rate limits
This commit is contained in:
1 parent
1de60bcfeb
commit
154af1367a
1 file changed
+1
-1
@@ -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({
|
||||
|
||||
Reference in new issue
Block a user