From edaecf6c1e8d028ebce19241e86c319eae74969a Mon Sep 17 00:00:00 2001 From: garrrikkotua Date: Mon, 11 Sep 2023 16:24:41 +0300 Subject: [PATCH] add logs to script --- .../integration_stream_worker/src/bin/process-webhook.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/services/apps/integration_stream_worker/src/bin/process-webhook.ts b/services/apps/integration_stream_worker/src/bin/process-webhook.ts index 0782c32d5e..950bc53c1a 100644 --- a/services/apps/integration_stream_worker/src/bin/process-webhook.ts +++ b/services/apps/integration_stream_worker/src/bin/process-webhook.ts @@ -29,16 +29,21 @@ setImmediate(async () => { const info = await repo.getWebhookById(webhookId) if (info) { + log.info({ webhookId }, 'Found webhook!') + if (![WebhookType.GITHUB, WebhookType.GROUPSIO, WebhookType.DISCORD].includes(info.type)) { log.error({ webhookId }, 'Webhook is not a supported type!') process.exit(1) } if (info.state !== WebhookState.PENDING) { + log.info({ webhookId }, 'Webhook is not pending, resetting...') await repo.markWebhookPending(webhookId) } + log.info({ webhookId }, 'Triggering webhook processing...') await emitter.triggerWebhookProcessing(info.tenantId, info.platform, info.id) + log.info({ webhookId }, 'Triggered webhook processing!') } else { log.error({ webhookId }, 'Webhook not found!') process.exit(1)