Skip to content

Commit

Permalink
fix(createPoolCluster): add pattern and selector to promise-based `ge…
Browse files Browse the repository at this point in the history
…tConnection` (#3017)

The implementation of `PromisePoolCluster#getConnection` does not match the capabilities of `PoolCluster#getConnection` nor the definition in `promise.d.ts`.

This change corrects this by adding the missing `pattern` and `selector` parameters which are passed through to the underlying method.

Fixes #1381
  • Loading branch information
TuckerWhitehouse authored Sep 9, 2024
1 parent dc3a680 commit ab7c49f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions promise.js
Original file line number Diff line number Diff line change
Expand Up @@ -451,10 +451,10 @@ class PromisePoolCluster extends EventEmitter {
inheritEvents(poolCluster, this, ['warn', 'remove']);
}

getConnection() {
getConnection(pattern, selector) {
const corePoolCluster = this.poolCluster;
return new this.Promise((resolve, reject) => {
corePoolCluster.getConnection((err, coreConnection) => {
corePoolCluster.getConnection(pattern, selector, (err, coreConnection) => {
if (err) {
reject(err);
} else {
Expand Down

0 comments on commit ab7c49f

Please sign in to comment.