Skip to content

Commit cecfcc7

Browse files
Setup delegation credential related crons (calcom#21176)
Co-authored-by: Tushar Bhatt <95581504+TusharBhatt1@users.noreply.github.com>
1 parent 0b3f9d0 commit cecfcc7

3 files changed

Lines changed: 18 additions & 0 deletions

File tree

apps/web/app/api/cron/credentials/route.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* @description This route is used to create and delete Credential records for all members of an organization that has delegation credentials enabled.
3+
*
4+
* It also deletes Credential records for all members of an organization that has delegation credentials disabled.
5+
*/
16
import type { NextRequest } from "next/server";
27
import { NextResponse } from "next/server";
38

apps/web/app/api/cron/selected-calendars/route.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* @description This route is used to create SelectedCalendar records based on Credential records corresponding to Delegation Credentials
3+
*
4+
* 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)
5+
*/
16
import type { NextRequest } from "next/server";
27
import { NextResponse } from "next/server";
38

apps/web/vercel.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@
1515
{
1616
"path": "/api/tasks/cleanup",
1717
"schedule": "0 0 * * *"
18+
},
19+
{
20+
"path": "/api/cron/credentials",
21+
"schedule": "*/5 * * * *"
22+
},
23+
{
24+
"path": "/api/cron/selected-calendars",
25+
"schedule": "*/5 * * * *"
1826
}
1927
],
2028
"functions": {

0 commit comments

Comments
 (0)