diff --git a/packages/node_modules/@node-red/runtime/lib/flows/index.js b/packages/node_modules/@node-red/runtime/lib/flows/index.js index c955dfe1c..2273e8b89 100644 --- a/packages/node_modules/@node-red/runtime/lib/flows/index.js +++ b/packages/node_modules/@node-red/runtime/lib/flows/index.js @@ -44,9 +44,11 @@ var activeNodesToFlow = {}; var typeEventRegistered = false; +let lastStarterStack + function init(runtime) { if (started) { - throw new Error("Cannot init without a stop"); + throw new Error("Cannot init without a stop:" + lastStarterStack); } settings = runtime.settings; storage = runtime.storage; @@ -274,7 +276,7 @@ async function start(type,diff,muteLog,isDeploy) { if (diff && diff.globalConfigChanged) { type = 'full' } - + lastStarterStack = new Error('Flows started here').stack started = true; state = 'start' var i; @@ -334,6 +336,7 @@ async function start(type,diff,muteLog,isDeploy) { log.info(log._("nodes.flows.stopped-flows")); events.emit("runtime-event",{id:"runtime-state",payload:{ state: 'stop', deploy:isDeploy },retain:true}); state = 'stop' + lastStarterStack = null started = false return } @@ -454,6 +457,7 @@ function stop(type,diff,muteLog,isDeploy) { if (diff.globalConfigChanged) { type = 'full' } + lastStarterStack = null started = false; state = 'stop' var promises = [];