You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
wiki/backend/tasks/simple/dispatch-webhook.ts

14 lines
395 B

/**
* Deliver one event to one webhook.
*
* Queued by `models/hooks.ts` → `emit()`, one job per subscribed webhook, so that a slow endpoint
* delays nothing else and a failing one is retried with the scheduler's backoff.
*/
export async function task(payload: {
hookId: string
event: string
data: Record<string, any>
}): Promise<void> {
await WIKI.models.hooks.deliver(payload)
}