From 929d8ae723dc3b824e09f62be54c3870f81f5bf9 Mon Sep 17 00:00:00 2001 From: ralphwetzel Date: Sat, 13 Apr 2024 22:35:58 +0200 Subject: [PATCH] Stop debugging session when flow is stopped. --- mcu_plugin.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/mcu_plugin.js b/mcu_plugin.js index 3fdc354..f596f37 100644 --- a/mcu_plugin.js +++ b/mcu_plugin.js @@ -854,6 +854,32 @@ module.exports = function(RED) { // The AbortController for runner_promise let runner_abort; + RED.events.on("flows:stopping", (...args) => { + + let flows = args[0]?.config?.flows; + + if (flows && Array.isArray(flows)) { + for (let i=0; i