-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtrigger.config.ts
More file actions
41 lines (37 loc) · 1.11 KB
/
trigger.config.ts
File metadata and controls
41 lines (37 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { prismaExtension } from '@trigger.dev/build/extensions/prisma'
import { defineConfig } from '@trigger.dev/sdk/v3'
import dotenv from 'dotenv'
import { z } from 'zod'
dotenv.config()
const project = z
.string({ message: 'Must have TRIGGER_PROJECT in environment to run trigger jobs' })
.parse(process.env.TRIGGER_PROJECT)
export default defineConfig({
project,
runtime: 'node',
logLevel: 'log',
maxDuration: 3600,
retries: {
enabledInDev: true,
default: {
maxAttempts: 1,
minTimeoutInMs: 1_000,
maxTimeoutInMs: 15_000,
factor: 2,
randomize: true,
},
},
dirs: ['./src/jobs'],
build: {
external: ['canvas', 'jsdom'],
extensions: [
prismaExtension({
schema: 'prisma/schema/main.prisma',
mode: 'legacy', //ref:https://trigger.dev/docs/config/extensions/prismaExtension
}),
// Untested, but can automatically sync Vercel env and trigger env using VERCEL_ACCESS_TOKEN, VERCEL_PROJECT_ID and VERCEL_TEAM_ID
// import { syncVercelEnvVars } from "@trigger.dev/build/extensions/core";
// syncVercelEnvVars(),
],
},
})