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
4 changes: 2 additions & 2 deletions src/app/api/(endpoints)/v1/fetch-updated-data/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ export const POST: RequestHandler<NextRouteContext> = withApiKey(
withEventRateLimit(
{
eventType: "fetch_updated_data_1d",
maxRequests: 100,
maxRequests: 500,
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

This endpoint makes external Google API calls (via updateBusinessReviews and updateBusinessStats) which may have associated costs or quotas. A 5x increase in the daily rate limit could significantly increase API usage and costs. Consider whether this increase aligns with Google API quotas and budget constraints, especially since this endpoint is called by 11ty during client website rebuilds.

Copilot uses AI. Check for mistakes.
windowMs: 24 * 60 * 60 * 1000,
}, // 24 hours
withEventRateLimit(
{
eventType: "fetch_updated_data_5m",
maxRequests: 10,
maxRequests: 25,
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

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

The daily rate limit increase (5x from 100 to 500) is significantly larger than the 5-minute rate limit increase (2.5x from 10 to 25). This changes the ratio between these limits from 10:1 to 20:1.

This means the new limits allow for more sustained, evenly-distributed traffic throughout the day relative to burst traffic. If this is intentional to support a specific use case (e.g., more frequent 11ty rebuilds), consider documenting the rationale. If the increases should be proportional, consider adjusting the 5-minute limit to 50 requests to maintain the 10:1 ratio.

Suggested change
maxRequests: 25,
maxRequests: 50,

Copilot uses AI. Check for mistakes.
windowMs: 5 * 60 * 1000,
}, // 5 minutes
withBody(schema, async (_, context) => {
Expand Down