Skip to content

add automatic connection release with Symbol.asyncDispose after execu… #3590

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/commands/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,12 @@
this.emit('error', err);
}
}

async [Symbol.asyncDispose](){

Check failure on line 326 in lib/commands/query.js

View workflow job for this annotation

GitHub Actions / lint-js

Insert `·`
if(this._connection){

Check failure on line 327 in lib/commands/query.js

View workflow job for this annotation

GitHub Actions / lint-js

Replace `(this._connection)` with `·(this._connection)·`
await this._connection.release();
}
}

Check warning on line 330 in lib/commands/query.js

View check run for this annotation

Codecov / codecov/patch

lib/commands/query.js#L327-L330

Added lines #L327 - L330 were not covered by tests
}

Query.prototype.catch = Query.prototype.then;
Expand Down
Loading