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

@@ -212,11 +212,12 @@ export class MongoStorageAdapter implements StorageAdapter {
throw error;
}
handleShutdown() {
async handleShutdown() {
if (!this.client) {
return Promise.resolve();
return;
}
return this.client.close(false);
await this.client.close(false);
delete this.connectionPromise;
}
_adaptiveCollection(name: string) {

View File

@@ -1194,7 +1194,9 @@ export class PostgresStorageAdapter implements StorageAdapter {
const now = new Date().getTime();
const helpers = this._pgp.helpers;
debug('deleteAllClasses');
if (this._client?.$pool.ended) {
return;
}
await this._client
.task('delete-all-classes', async t => {
try {