From ab7c49f24fad7b241cdc0046ead9917bbddccced Mon Sep 17 00:00:00 2001 From: Tucker Whitehouse Date: Mon, 9 Sep 2024 08:05:02 -0400 Subject: [PATCH] fix(createPoolCluster): add pattern and selector to promise-based `getConnection` (#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 --- promise.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/promise.js b/promise.js index 95c5808b45..5d80e21e72 100644 --- a/promise.js +++ b/promise.js @@ -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 {