From cecfcc7c6f775885495a107c29f4da3cddd8b2c3 Mon Sep 17 00:00:00 2001 From: Hariom Balhara Date: Fri, 9 May 2025 13:29:31 +0530 Subject: [PATCH] Setup delegation credential related crons (#21176) Co-authored-by: Tushar Bhatt <95581504+TusharBhatt1@users.noreply.github.com> --- apps/web/app/api/cron/credentials/route.ts | 5 +++++ apps/web/app/api/cron/selected-calendars/route.ts | 5 +++++ apps/web/vercel.json | 8 ++++++++ 3 files changed, 18 insertions(+) diff --git a/apps/web/app/api/cron/credentials/route.ts b/apps/web/app/api/cron/credentials/route.ts index e9eb87502e..4879efed8c 100644 --- a/apps/web/app/api/cron/credentials/route.ts +++ b/apps/web/app/api/cron/credentials/route.ts @@ -1,3 +1,8 @@ +/** + * @description This route is used to create and delete Credential records for all members of an organization that has delegation credentials enabled. + * + * It also deletes Credential records for all members of an organization that has delegation credentials disabled. + */ import type { NextRequest } from "next/server"; import { NextResponse } from "next/server"; diff --git a/apps/web/app/api/cron/selected-calendars/route.ts b/apps/web/app/api/cron/selected-calendars/route.ts index 897c3483a7..a94fe0a27d 100644 --- a/apps/web/app/api/cron/selected-calendars/route.ts +++ b/apps/web/app/api/cron/selected-calendars/route.ts @@ -1,3 +1,8 @@ +/** + * @description This route is used to create SelectedCalendar records based on Credential records corresponding to Delegation Credentials + * + * It works in conjunction with `/api/cron/credentials` route(which creates the Credential records for all the members of an organization that has delegation credentials enabled) + */ import type { NextRequest } from "next/server"; import { NextResponse } from "next/server"; diff --git a/apps/web/vercel.json b/apps/web/vercel.json index dc6e6899d0..3e648c6b08 100644 --- a/apps/web/vercel.json +++ b/apps/web/vercel.json @@ -15,6 +15,14 @@ { "path": "/api/tasks/cleanup", "schedule": "0 0 * * *" + }, + { + "path": "/api/cron/credentials", + "schedule": "*/5 * * * *" + }, + { + "path": "/api/cron/selected-calendars", + "schedule": "*/5 * * * *" } ], "functions": {