0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

Added debug info to controller process messages

- Whenever Ghost sends a message to its controller process
- Send extra debug info, so we can be sure what the Ghost process is seeing
This commit is contained in:
Hannah Wolfe 2020-04-02 12:06:14 +01:00
parent 12d6b05498
commit 022a433e56

View file

@ -25,6 +25,13 @@ function GhostServer(rootApp) {
this.config = config; this.config = config;
} }
const debugInfo = {
versions: process.versions,
platform: process.platform,
arch: process.arch,
release: process.release
};
/** /**
* ## Public API methods * ## Public API methods
* *
@ -333,7 +340,8 @@ module.exports.announceServerStart = function announceServerStart() {
// CASE: IPC communication to the CLI via child process. // CASE: IPC communication to the CLI via child process.
if (process.send) { if (process.send) {
process.send({ process.send({
started: true started: true,
debug: debugInfo
}); });
} }
@ -364,7 +372,8 @@ module.exports.announceServerStopped = function announceServerStopped(error) {
if (process.send) { if (process.send) {
process.send({ process.send({
started: false, started: false,
error: error error: error,
debug: debugInfo
}); });
} }
@ -372,7 +381,8 @@ module.exports.announceServerStopped = function announceServerStopped(error) {
if (config.get('bootstrap-socket')) { if (config.get('bootstrap-socket')) {
return connectToBootstrapSocket({ return connectToBootstrapSocket({
started: false, started: false,
error: error error: error,
debug: debugInfo
}); });
} }