-
Notifications
You must be signed in to change notification settings - Fork 147
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
implemented maxConnectionPoolSize logic #289
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ali-ince changes look good. Made couple minor comments. Maybe also worth adding an integration test for max connections. All this can be done in a separate PR.
@@ -59,7 +59,11 @@ class Driver { | |||
this._createConnection.bind(this), | |||
this._destroyConnection.bind(this), | |||
this._validateConnection.bind(this), | |||
config.connectionPoolSize | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about adding a dedicated PoolConfig
class for this object?
Then it will be possible to specify type of config
constructor parameter in Pool
in JSDoc and get autocompletion from Intellij.
src/v1/internal/pool.js
Outdated
if (!pool) { | ||
pool = []; | ||
this._pools[key] = pool; | ||
let resource = this._acquire(key); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe change let
s and var
s to const
s in this class, where possible.
src/v1/internal/util.js
Outdated
@@ -114,6 +116,22 @@ function trimAndVerify(string, name, url) { | |||
return result; | |||
} | |||
|
|||
function promiseOrTimeout(timeout, otherPromise, onTimeout) { | |||
let timeoutPromise = new Promise((resolve, reject) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use const
No description provided.