Skip to content

Commit

Permalink
fix: modules getting stuck unable to start
Browse files Browse the repository at this point in the history
  • Loading branch information
Julusian committed Dec 1, 2023
1 parent a586c41 commit b6f39a2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/Instance/Host.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ class ModuleHost {
// Force restart the connection, as it failed to initialise and will be broken
child.restartCount++

child.monitor.off('exit', forceRestart)
child.monitor.off('message', initHandler)

// Report the failure
startupFailed(new Error('Restart forced'))

Expand Down Expand Up @@ -175,6 +178,9 @@ class ModuleHost {
.then(() => {
child.restartCount = 0

child.monitor.off('exit', forceRestart)
child.monitor.off('message', initHandler)

startupCompleted()

// mark child as ready to receive
Expand All @@ -195,6 +201,7 @@ class ModuleHost {
}
}
child.monitor.on('message', initHandler)
child.monitor.on('exit', forceRestart)
}

/**
Expand Down

0 comments on commit b6f39a2

Please sign in to comment.