From 339655611fcf05ebdf9be7c452bc1164333f122e Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Sat, 11 Feb 2023 09:46:10 -0600 Subject: [PATCH] fix(core): Fix issue that worker and webhook service close directly (#5461) --- packages/cli/src/commands/webhook.ts | 3 +++ packages/cli/src/commands/worker.ts | 3 +++ 2 files changed, 6 insertions(+) diff --git a/packages/cli/src/commands/webhook.ts b/packages/cli/src/commands/webhook.ts index c061efbcb..2bacd7912 100644 --- a/packages/cli/src/commands/webhook.ts +++ b/packages/cli/src/commands/webhook.ts @@ -80,6 +80,9 @@ export class Webhook extends BaseCommand { async run() { await new WebhookServer().start(); this.logger.info('Webhook listener waiting for requests.'); + + // Make sure that the process does not close + await new Promise(() => {}); } async catch(error: Error) { diff --git a/packages/cli/src/commands/worker.ts b/packages/cli/src/commands/worker.ts index bd4c09266..66073ed71 100644 --- a/packages/cli/src/commands/worker.ts +++ b/packages/cli/src/commands/worker.ts @@ -353,6 +353,9 @@ export class Worker extends BaseCommand { } }); } + + // Make sure that the process does not close + await new Promise(() => {}); } async catch(error: Error) {