Skip to content

Commit

Permalink
chore: only register inngest functions for events that we send webhoo…
Browse files Browse the repository at this point in the history
…ks for
  • Loading branch information
tonyxiao committed Mar 15, 2024
1 parent fb6b76a commit 579491d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions apps/web/pages/api/inngest.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import {serve} from 'inngest/next'
import type {Events} from '@usevenice/engine-backend/events'
import {eventMap, inngest} from '@usevenice/engine-backend/events'
import {
inngest,
outgoingWebhookEventMap,
} from '@usevenice/engine-backend/events'
import {withLog} from '@usevenice/util'
import {sendWebhook} from '../../inngest/function-factory'
import * as functions from '../../inngest/functions'
Expand All @@ -17,7 +20,7 @@ export default serve(
// MARK: - Workaround for Inngest not having support for
// multiple event triggers in a single function
// @see https://discord.com/channels/842170679536517141/1214066130860118087/1214283616327180318
...Object.keys(eventMap).map((name) =>
...Object.keys(outgoingWebhookEventMap).map((name) =>
inngest.createFunction(
{id: `send-webhook/${name}`},
{event: name as keyof Events},
Expand Down

0 comments on commit 579491d

Please sign in to comment.