Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion website/server/src/utils/dailyRateLimit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Ratelimit } from '@upstash/ratelimit';
import { Redis } from '@upstash/redis';
import { logInfo } from './logger.js';

const DAILY_LIMIT = 10;
const DAILY_LIMIT = 30;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

For better flexibility and to avoid future code changes for adjustments, consider making the daily rate limit configurable via an environment variable. This would allow changing the limit without a new deployment, which is a common practice for values that might change based on operational needs.

Suggested change
const DAILY_LIMIT = 30;
const DAILY_LIMIT = Number.parseInt(process.env.DAILY_RATE_LIMIT ?? '30', 10);


const createDailyRateLimiter = (): Ratelimit | null => {
const url = process.env.UPSTASH_REDIS_REST_URL;
Expand Down
Loading