Skip to content

Commit

Permalink
set maxDuration for functions that have slow tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
aggre committed Jul 23, 2024
1 parent 293a278 commit 02100d2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 0 additions & 2 deletions src/pages/api/cron/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ const { PUBLIC_INFURA_KEY } = import.meta.env

const queue = new PQueue({ concurrency: 5 })

export const maxDuration = 30

const sTokensPropertyAddressFetcher = async (
contract: Contract,
id: string,
Expand Down
2 changes: 0 additions & 2 deletions src/pages/api/profile/[id]/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ export type AssetsResponse = {
memberships: AssetItem[]
}

export const maxDuration = 30

const fetchAllMemberships = async ({
id,
provider,
Expand Down
8 changes: 8 additions & 0 deletions vercel.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@
"schedule": "0 0 * * *"
}
],
"functions": {
"src/pages/api/profile/[id]/assets.ts": {
"maxDuration": 300
},
"src/pages/api/cron/**/*": {
"maxDuration": 300
}
},
"git": {
"deploymentEnabled": false
}
Expand Down

0 comments on commit 02100d2

Please sign in to comment.