Skip to content

Commit

Permalink
decreased generations to 2 temporarily
Browse files Browse the repository at this point in the history
  • Loading branch information
Nutlope committed Mar 10, 2023
1 parent ad23a63 commit f3e63dc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pages/api/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ interface ExtendedNextApiRequest extends NextApiRequest {
};
}

// Create a new ratelimiter, that allows 5 requests per 24 hours
// Create a new ratelimiter, that allows 2 requests per 24 hours
const ratelimit = redis
? new Ratelimit({
redis: redis,
limiter: Ratelimit.fixedWindow(5, "1440 m"),
limiter: Ratelimit.fixedWindow(2, "1440 m"),
analytics: true,
})
: undefined;
Expand Down
2 changes: 1 addition & 1 deletion pages/api/remaining.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default async function handler(
const minutes = Math.floor(diff / 1000 / 60) - hours * 60;

const remainingGenerations =
Number(usedGenerations) > 5 ? 0 : 5 - Number(usedGenerations);
Number(usedGenerations) > 2 ? 0 : 2 - Number(usedGenerations);

return res.status(200).json({ remainingGenerations, hours, minutes });
}

1 comment on commit f3e63dc

@vercel
Copy link

@vercel vercel bot commented on f3e63dc Mar 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.