From 9b0b3ad363aea1b4bdce67c755c8f78a44d4edb7 Mon Sep 17 00:00:00 2001 From: NicolasBohn Date: Sat, 21 Mar 2026 21:30:58 +0100 Subject: [PATCH] fix: migrate remaining inngest v3 trigger syntax to v4 --- lib/inngest/functions.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/inngest/functions.ts b/lib/inngest/functions.ts index 718cf19..e4e47dc 100644 --- a/lib/inngest/functions.ts +++ b/lib/inngest/functions.ts @@ -8,8 +8,7 @@ import { getFormattedTodayDate } from "@/lib/utils"; import { callAIProviderWithFallback } from "@/lib/ai-provider"; export const sendSignUpEmail = inngest.createFunction( - { id: 'sign-up-email' }, - { event: 'app/user.created' }, + { id: 'sign-up-email', triggers: [{ event: 'app/user.created' }] }, async ({ event, step }) => { const userProfile = ` - Country: ${event.data.country} @@ -55,8 +54,7 @@ export const sendSignUpEmail = inngest.createFunction( // Rename to Weekly export const sendWeeklyNewsSummary = inngest.createFunction( - { id: 'weekly-news-summary' }, - [{ event: 'app/send.weekly.news' }, { cron: '0 9 * * 1' }], // Every Monday at 9AM + { id: 'weekly-news-summary', triggers: [{ event: 'app/send.weekly.news' }, { cron: '0 9 * * 1' }] }, // Every Monday at 9AM async ({ step }) => { // Step 1: Fetch General Market News const articles = await step.run('fetch-general-news', async () => { @@ -205,8 +203,7 @@ export const sendWeeklyNewsSummary = inngest.createFunction( ) export const checkStockAlerts = inngest.createFunction( - { id: 'check-stock-alerts' }, - { cron: '*/5 * * * *' }, // Run every 5 minutes + { id: 'check-stock-alerts', triggers: [{ cron: '*/5 * * * *' }] }, // Run every 5 minutes async ({ step }) => { // Step 1: Fetch active alerts const activeAlerts = await step.run('fetch-active-alerts', async () => { @@ -297,8 +294,7 @@ export const checkStockAlerts = inngest.createFunction( ); export const checkInactiveUsers = inngest.createFunction( - { id: 'check-inactive-users' }, - { cron: '0 10 * * *' }, // Run every day at 10 AM + { id: 'check-inactive-users', triggers: [{ cron: '0 10 * * *' }] }, // Run every day at 10 AM async ({ step }) => { // Step 1: Fetch Inactive Users const inactiveUsers = await step.run('fetch-inactive-users', async () => {