@trenskow/pged 5.1.71 → 5.1.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +4 -5
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -47,9 +47,8 @@ export default class PGed extends EventEmitter {
|
|
|
47
47
|
options.casing.js = options.casing.hs || 'camel';
|
|
48
48
|
|
|
49
49
|
options.connection = options.connection || {};
|
|
50
|
-
options.
|
|
51
|
-
options.
|
|
52
|
-
options.connection.retry.delay = options.connection.retry.delay || '0s';
|
|
50
|
+
options.connectionRetryCount = options.connectionRetryCount || 1;
|
|
51
|
+
options.connectionRetryDelay = options.connectionRetryDelay || '0s';
|
|
53
52
|
|
|
54
53
|
options.defaultPrimaryKey = options.defaultPrimaryKey || 'id';
|
|
55
54
|
|
|
@@ -122,14 +121,14 @@ export default class PGed extends EventEmitter {
|
|
|
122
121
|
|
|
123
122
|
let connectionCount = 0;
|
|
124
123
|
|
|
125
|
-
while (connectionCount < this._options.
|
|
124
|
+
while (connectionCount < this._options.connectionRetryCount) {
|
|
126
125
|
try {
|
|
127
126
|
connectionCount++;
|
|
128
127
|
this._client = await pool.connect();
|
|
129
128
|
break;
|
|
130
129
|
} catch (error) {
|
|
131
130
|
|
|
132
|
-
if (connectionCount == this._options.
|
|
131
|
+
if (connectionCount == this._options.connectionRetryCount) {
|
|
133
132
|
throw error;
|
|
134
133
|
}
|
|
135
134
|
|