Skip to content

OpenStock is an open-source alternative to expensive market platforms. Track real-time prices, set personalized alerts, and explore detailed company insights — built openly, for everyone, forever free.

fix: migrate remaining inngest v3 trigger syntax to v4

NicolasBohn9b0b3ad363ae
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 () => {