chore: Webhook Scaffolding cleanup (#27159)

* quick cleanup

* more fixes
This commit is contained in:
Syed Ali Shahbaz authored and GitHub committed 2026-01-22 16:11:10 -03:00
1 parent 2542e1e5c4
commit 857b3da875
10 files changed
+126 -150

No files matched your search

@@ -1,28 +1,26 @@
import { getWebhookTaskConsumer } from "@calcom/features/di/webhooks/containers/webhook";
import { webhookTaskPayloadSchema } from "@calcom/features/webhooks/lib/types/webhookTask";
import logger from "@calcom/lib/logger";
import type { ILogger } from "@calcom/lib/tasker/types";
/**
* Webhook Delivery Task Handler
*
*
* This task is queued by WebhookTaskerProducerService and processed here.
* It delegates to WebhookTaskConsumer (via DI) which handles the heavy lifting:
* - Fetching webhook subscribers
* - Fetching event-specific data from database
* - Building versioned webhook payloads
* - Sending HTTP requests to subscriber URLs
*
*
* This handler can be deployed to trigger.dev for scalability.
*/
const log = logger.getSubLogger({ prefix: ["webhookDelivery"] });
const log: ILogger = logger.getSubLogger({ prefix: ["webhookDelivery"] });
export async function webhookDelivery(payload: string, taskId?: string): Promise<void> {
try {
if (!taskId) {
log.error("Task ID is required for webhook delivery consumer", {
taskId,
});
throw new Error("Task ID is required for webhook delivery consumer");
}