Skip to content

Commit

Permalink
Add pattern and selector to PromisePoolCluster#getConnection
Browse files Browse the repository at this point in the history
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 sidorares#1381 

Note: I may have missed them, but I didn't see any tests for PromisePoolCluster to update or add to with this change.
  • Loading branch information
TuckerWhitehouse authored Sep 5, 2024
1 parent ac200fe commit 0007f0c
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 0007f0c

Please sign in to comment.