From 3f6fc31c55e62d76233e2563f8bc638adefca84b Mon Sep 17 00:00:00 2001 From: pvillaverde <31769405+pvillaverde@users.noreply.github.com> Date: Thu, 16 May 2024 17:51:51 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A5=85=20Exit=20on=20task=20end?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main.ts b/src/main.ts index 6edf09a..e6b0388 100644 --- a/src/main.ts +++ b/src/main.ts @@ -48,6 +48,10 @@ switch (task) { } if (!keepRuning) { - connection.end(); - mqttService.end(); + try { + connection.end(); + mqttService.end(); + } catch (_error) { + Deno.exit(0); + } }