fix: LiveQuery server is not shut down properly when handleShutdown is called (#8491)

This commit is contained in:
Daniel
2023-06-08 19:04:49 +10:00
committed by GitHub
parent 3ea1ace631
commit 967700bdbc
5 changed files with 63 additions and 4 deletions

View File

@@ -168,6 +168,12 @@ class ParseServer {
if (cacheAdapter && typeof cacheAdapter.handleShutdown === 'function') {
promises.push(cacheAdapter.handleShutdown());
}
if (this.liveQueryServer?.server?.close) {
promises.push(new Promise(resolve => this.liveQueryServer.server.close(resolve)));
}
if (this.liveQueryServer) {
promises.push(this.liveQueryServer.shutdown());
}
return (promises.length > 0 ? Promise.all(promises) : Promise.resolve()).then(() => {
if (this.config.serverCloseComplete) {
this.config.serverCloseComplete();