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.

move maxDuration to vercel.json

Steven Tey3a94a63623d6
diff --git a/apps/web/app/api/cron/import/bitly/route.ts b/apps/web/app/api/cron/import/bitly/route.ts
index 6241b3b2aa..425bd03b53 100644
--- a/apps/web/app/api/cron/import/bitly/route.ts
+++ b/apps/web/app/api/cron/import/bitly/route.ts
@@ -6,8 +6,6 @@ import { log } from "@dub/utils";
import { NextResponse } from "next/server";
import { importLinksFromBitly } from "./utils";
-export const maxDuration = process.env.NEXT_PUBLIC_IS_DUB ? 300 : 10
-
export async function POST(req: Request) {
const body = await req.json();
if (process.env.VERCEL === "1") {
diff --git a/apps/web/app/api/cron/import/csv/route.ts b/apps/web/app/api/cron/import/csv/route.ts
index 3cd1bd32e7..5a32d09640 100644
--- a/apps/web/app/api/cron/import/csv/route.ts
+++ b/apps/web/app/api/cron/import/csv/route.ts
@@ -3,8 +3,6 @@ import { log } from "@dub/utils";
import { NextResponse } from "next/server";
import { importLinksFromCSV } from "./utils";
-export const maxDuration = process.env.NEXT_PUBLIC_IS_DUB ? 300 : 10
-
export async function POST(req: Request) {
const body = await req.json();
if (process.env.VERCEL === "1") {
diff --git a/apps/web/app/api/cron/import/rebrandly/route.ts b/apps/web/app/api/cron/import/rebrandly/route.ts
index 56dc1516dd..b5bc9695a9 100644
--- a/apps/web/app/api/cron/import/rebrandly/route.ts
+++ b/apps/web/app/api/cron/import/rebrandly/route.ts
@@ -5,8 +5,6 @@ import { log } from "@dub/utils";
import { NextResponse } from "next/server";
import { importLinksFromRebrandly, importTagsFromRebrandly } from "./utils";
-export const maxDuration = process.env.NEXT_PUBLIC_IS_DUB ? 300 : 10
-
export async function POST(req: Request) {
const body = await req.json();
if (process.env.VERCEL === "1") {
diff --git a/apps/web/app/api/cron/import/short/route.ts b/apps/web/app/api/cron/import/short/route.ts
index c09663606c..798bdde0b7 100644
--- a/apps/web/app/api/cron/import/short/route.ts
+++ b/apps/web/app/api/cron/import/short/route.ts
@@ -4,8 +4,6 @@ import { log } from "@dub/utils";
import { NextResponse } from "next/server";
import { importLinksFromShort } from "./utils";
-export const maxDuration = process.env.NEXT_PUBLIC_IS_DUB ? 300 : 10
-
export async function POST(req: Request) {
const body = await req.json();
if (process.env.VERCEL === "1") {
diff --git a/apps/web/vercel.json b/apps/web/vercel.json
index 7ce88bed66..7ca0aee403 100644
--- a/apps/web/vercel.json
+++ b/apps/web/vercel.json
@@ -8,5 +8,10 @@
"path": "/api/cron/usage",
"schedule": "0 14 * * *"
}
- ]
+ ],
+ "functions": {
+ "app/api/cron/**/*": {
+ "maxDuration": 300
+ }
+ }
}