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.

update to 15 mins

Steven Teyc3f2e7da1d39
diff --git a/apps/web/app/api/cron/links/usage/route.ts b/apps/web/app/api/cron/links/usage/route.ts
index 614c23b7da..5ba04adc57 100644
--- a/apps/web/app/api/cron/links/usage/route.ts
+++ b/apps/web/app/api/cron/links/usage/route.ts
@@ -4,7 +4,7 @@ import { log } from "@dub/utils";
import { sendLinksUsageEmail } from "./utils";
// Cron to update the links usage of each workspace.
-// Runs once every 10 mins (*/10 * * * *)
+// Runs once every 15 mins (*/15 * * * *)
export async function GET(req: Request) {
const validSignature = await verifySignature(req);
@@ -13,11 +13,11 @@ export async function GET(req: Request) {
return new Response("Unauthorized", { status: 401 });
}
- // get links created in the last 10 minutes
+ // get links created in the last 15 minutes
const links = await prisma.link.findMany({
where: {
createdAt: {
- gte: new Date(Date.now() - 10 * 60 * 1000),
+ gte: new Date(Date.now() - 15 * 60 * 1000),
},
},
select: {
@@ -30,7 +30,7 @@ export async function GET(req: Request) {
.filter(Boolean) as string[];
console.log(
- "Links created in the last 10 minutes: ",
+ "Links created in the last 15 minutes: ",
links.length,
"Workspaces to check: ",
workspacesToCheck,
diff --git a/apps/web/vercel.json b/apps/web/vercel.json
index f0192aa598..a3b32a8b7b 100644
--- a/apps/web/vercel.json
+++ b/apps/web/vercel.json
@@ -10,7 +10,7 @@
},
{
"path": "/api/cron/links/usage",
- "schedule": "*/10 * * * *"
+ "schedule": "*/15 * * * *"
}
],
"functions": {