diff --git a/src/discovery/discovery-service.ts b/src/discovery/discovery-service.ts index ee704621..6eaea11f 100644 --- a/src/discovery/discovery-service.ts +++ b/src/discovery/discovery-service.ts @@ -150,4 +150,8 @@ export default class DiscoveryService extends AuthenticatedService { await this.pool.destroy(ctx); } + + async [Symbol.asyncDispose]() { + return this.destroy(); + } } diff --git a/tsconfig-cjs.json b/tsconfig-cjs.json index 57618278..7b5c494c 100644 --- a/tsconfig-cjs.json +++ b/tsconfig-cjs.json @@ -1,6 +1,7 @@ { "extends": "./tsconfig-base.json", "compilerOptions": { + "lib": ["ES2022","ESNext.Disposable"], "target": "es2017", "module": "commonjs", "outDir": "build/cjs" diff --git a/tsconfig-esm.json b/tsconfig-esm.json index 2cedbf4e..778fff02 100644 --- a/tsconfig-esm.json +++ b/tsconfig-esm.json @@ -1,6 +1,7 @@ { "extends": "./tsconfig-base.json", "compilerOptions": { + "lib": ["ES2022","ESNext.Disposable"], "module": "commonjs", "outDir": "build/esm", "target": "esnext" diff --git a/tsconfig.json b/tsconfig.json index 57618278..7b5c494c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "./tsconfig-base.json", "compilerOptions": { + "lib": ["ES2022","ESNext.Disposable"], "target": "es2017", "module": "commonjs", "outDir": "build/cjs"