fix: migrate remaining inngest v3 trigger syntax to v4

This commit is contained in:
NicolasBohn 2026-03-21 21:30:58 +01:00 committed by user
parent addb7e2c33
commit 9b0b3ad363
1 changed files with 4 additions and 8 deletions

View File

@ -8,8 +8,7 @@ import { getFormattedTodayDate } from "@/lib/utils";
import { callAIProviderWithFallback } from "@/lib/ai-provider"; import { callAIProviderWithFallback } from "@/lib/ai-provider";
export const sendSignUpEmail = inngest.createFunction( export const sendSignUpEmail = inngest.createFunction(
{ id: 'sign-up-email' }, { id: 'sign-up-email', triggers: [{ event: 'app/user.created' }] },
{ event: 'app/user.created' },
async ({ event, step }) => { async ({ event, step }) => {
const userProfile = ` const userProfile = `
- Country: ${event.data.country} - Country: ${event.data.country}
@ -55,8 +54,7 @@ export const sendSignUpEmail = inngest.createFunction(
// Rename to Weekly // Rename to Weekly
export const sendWeeklyNewsSummary = inngest.createFunction( export const sendWeeklyNewsSummary = inngest.createFunction(
{ id: 'weekly-news-summary' }, { id: 'weekly-news-summary', triggers: [{ event: 'app/send.weekly.news' }, { cron: '0 9 * * 1' }] }, // Every Monday at 9AM
[{ event: 'app/send.weekly.news' }, { cron: '0 9 * * 1' }], // Every Monday at 9AM
async ({ step }) => { async ({ step }) => {
// Step 1: Fetch General Market News // Step 1: Fetch General Market News
const articles = await step.run('fetch-general-news', async () => { const articles = await step.run('fetch-general-news', async () => {
@ -205,8 +203,7 @@ export const sendWeeklyNewsSummary = inngest.createFunction(
) )
export const checkStockAlerts = inngest.createFunction( export const checkStockAlerts = inngest.createFunction(
{ id: 'check-stock-alerts' }, { id: 'check-stock-alerts', triggers: [{ cron: '*/5 * * * *' }] }, // Run every 5 minutes
{ cron: '*/5 * * * *' }, // Run every 5 minutes
async ({ step }) => { async ({ step }) => {
// Step 1: Fetch active alerts // Step 1: Fetch active alerts
const activeAlerts = await step.run('fetch-active-alerts', async () => { const activeAlerts = await step.run('fetch-active-alerts', async () => {
@ -297,8 +294,7 @@ export const checkStockAlerts = inngest.createFunction(
); );
export const checkInactiveUsers = inngest.createFunction( export const checkInactiveUsers = inngest.createFunction(
{ id: 'check-inactive-users' }, { id: 'check-inactive-users', triggers: [{ cron: '0 10 * * *' }] }, // Run every day at 10 AM
{ cron: '0 10 * * *' }, // Run every day at 10 AM
async ({ step }) => { async ({ step }) => {
// Step 1: Fetch Inactive Users // Step 1: Fetch Inactive Users
const inactiveUsers = await step.run('fetch-inactive-users', async () => { const inactiveUsers = await step.run('fetch-inactive-users', async () => {