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); + } }