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.

add cron job

Kiran Ke88f2083d8ee
diff --git a/apps/web/app/(ee)/api/cron/partner-program-summary/route.ts b/apps/web/app/(ee)/api/cron/partner-program-summary/route.ts
index 3ac6547f61..a3ebcd173d 100644
--- a/apps/web/app/(ee)/api/cron/partner-program-summary/route.ts
+++ b/apps/web/app/(ee)/api/cron/partner-program-summary/route.ts
@@ -15,7 +15,7 @@ import { z } from "zod";
/**
* This route handles the monthly partner program summary emails for partners.
- * Scheduled to run once every month on the 1st day of the month to send the previous month's summary.
+ * Scheduled to run at 1 AM on the 1st day of every month to send the previous month's summary.
*
* 1. Processing Flow:
* - Processes one program at a time (paginated)
@@ -261,14 +261,11 @@ async function handler(req: Request) {
})
.filter(({ lifetime }) => lifetime.leads > 0);
- console.log(summary);
-
await Promise.allSettled(
summary.map(({ partner, comparisonMonth, previousMonth, lifetime }) => {
limiter.schedule(() =>
sendEmail({
subject: `${program.name} partner program summary`,
- // email: partner.email!,
email: partner.email!,
react: PartnerProgramSummary({
program,
diff --git a/apps/web/vercel.json b/apps/web/vercel.json
index 8edbed602d..d534ee0edb 100644
--- a/apps/web/vercel.json
+++ b/apps/web/vercel.json
@@ -35,6 +35,10 @@
{
"path": "/api/cron/payouts/reminders",
"schedule": "0 14 * * *"
+ },
+ {
+ "path": "/api/cron/partner-program-summary",
+ "schedule": "0 1 1 * *"
}
],
"functions": {