0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

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
This commit is contained in:
Daniel Lockyer 2020-08-13 17:19:42 +01:00
parent 35b9b7cc8c
commit d4f1274ba5

View file

@ -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() {