Add trace for who last started the stack

debug-tests
Nick O'Leary 2024-03-21 20:48:35 +00:00
parent bd57bce2d3
commit 884bbe01f0
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
1 changed files with 6 additions and 2 deletions

View File

@ -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 = [];