Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

reduce cron limit, give free plan more leeway

Steven Tey8e15f29cbc8e
diff --git a/apps/web/app/api/cron/usage/utils.ts b/apps/web/app/api/cron/usage/utils.ts
index 7648a90f0e..f63756d98b 100644
--- a/apps/web/app/api/cron/usage/utils.ts
+++ b/apps/web/app/api/cron/usage/utils.ts
@@ -12,7 +12,7 @@ import {
import { sendEmail } from "emails";
import ClicksSummary from "emails/clicks-summary";
-const limit = 250;
+const limit = 100;
export const updateUsage = async (skip?: number) => {
const workspaces = await prisma.project.findMany({
@@ -184,13 +184,13 @@ export const updateUsage = async (skip?: number) => {
const { plan, usage, usageLimit } = workspace;
// only reset clicks usage if it's not over usageLimit by:
- // 2x for free plan (2K clicks)
+ // 3x for free plan (3K clicks)
// 1.5x for pro plan (75K clicks)
// 1.2x for business plan (300K clicks)
const resetUsage =
plan === "free"
- ? usage < usageLimit * 2
+ ? usage < usageLimit * 3
: plan === "pro"
? usage < usageLimit * 1.5
: plan.startsWith("business")