From 8bde19910120face01089e311bb6c3446acfb41b Mon Sep 17 00:00:00 2001 From: kirrg001 Date: Tue, 14 Aug 2018 13:55:49 +0200 Subject: [PATCH] Added timeout before exiting the process no issue - IPC communication happens before we trigger process.exit - this is a timing issue - we should give IPC a little time to finish sending the message over to the CLI - wait 100ms before exiting the process --- core/server/index.js | 4 +++- index.js | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/core/server/index.js b/core/server/index.js index 97e54d3642..540431c315 100644 --- a/core/server/index.js +++ b/core/server/index.js @@ -133,7 +133,9 @@ const minimalRequiredSetupToStartGhost = (dbState) => { return GhostServer.announceServerStopped(err) .finally(() => { common.logging.error(err); - process.exit(-1); + setTimeout(() => { + process.exit(-1); + }, 100); }); }); diff --git a/index.js b/index.js index 5f44564a67..1157b0bd4a 100644 --- a/index.js +++ b/index.js @@ -41,6 +41,8 @@ ghost().then(function (ghostServer) { return GhostServer.announceServerStopped(err) .finally(() => { common.logging.error(err); - process.exit(-1); + setTimeout(() => { + process.exit(-1); + }, 100); }); });