From d4f1274ba5f1a52cd5fc2815cb7cf17690b44b71 Mon Sep 17 00:00:00 2001 From: Daniel Lockyer Date: Thu, 13 Aug 2020 17:19:42 +0100 Subject: [PATCH] Returned empty promises in ghost-server - I have no idea why this is required and I really don't like it - this change looks superfluous but I had problems with Ghost not displaying shutting down messages properly and this is the only thing that got it working - the async-awaits were getting stuck in `await this._cleanup()`, and then wouldn't enter into the `finally` block - oddly, this was only reproducible when a job was running, it would shut down normally otherwise - if I find the solution in the mean time, I'll happily get rid of this --- core/server/ghost-server.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/server/ghost-server.js b/core/server/ghost-server.js index b4d59de273..a5d7439d77 100644 --- a/core/server/ghost-server.js +++ b/core/server/ghost-server.js @@ -169,6 +169,9 @@ class GhostServer { this.httpServer = null; this._logStopMessages(); } + + // TODO: investigate why this is required (see commit) + return Promise.resolve(); } /** @@ -203,6 +206,9 @@ class GhostServer { // Wait for all cleanup tasks to finish await Promise .all(this.cleanupTasks.map(task => task())); + + // TODO: investigate why this is required (see commit) + return Promise.resolve(); } _onShutdownComplete() {