Skip to content

Commit a5e90a1

Browse files
author
Zhen
committed
Reset default config value
1 parent eed4734 commit a5e90a1

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/v1/driver.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -238,19 +238,19 @@ class _ConnectionStreamObserver extends StreamObserver {
238238
* @private
239239
*/
240240
function sanitizeConfig(config) {
241-
config.maxConnectionLifetime = sanitizeIntValue(config.maxConnectionLifetime);
241+
config.maxConnectionLifetime = sanitizeIntValue(config.maxConnectionLifetime, 60*60*1000);
242242
config.maxConnectionPoolSize = sanitizeIntValue(config.maxConnectionPoolSize);
243243
config.connectionAcquisitionTimeout = sanitizeIntValue(config.connectionAcquisitionTimeout);
244244
}
245245

246-
function sanitizeIntValue(value) {
246+
function sanitizeIntValue(value, defaultValue=null) {
247247
if (value) {
248248
const sanitizedValue = parseInt(value, 10);
249249
if (sanitizedValue && sanitizedValue > 0) {
250250
return sanitizedValue;
251251
}
252252
}
253-
return null;
253+
return defaultValue;
254254
}
255255

256256
export {Driver, READ, WRITE}

src/v1/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ const USER_AGENT = "neo4j-javascript/" + VERSION;
111111
* // The max number of connections that are allowed idle in the pool at any time.
112112
* // Connection will be destroyed if this threshold is exceeded.
113113
* // <b>Deprecated:</b> please use <code>maxConnectionPoolSize</code> instead.
114-
* connectionPoolSize: 50,
114+
* connectionPoolSize: 100,
115115
*
116116
* // The maximum total number of connections allowed to be managed by the connection pool, per host.
117117
* // This includes both in-use and idle connections. No maximum connection pool size is imposed
@@ -125,7 +125,7 @@ const USER_AGENT = "neo4j-javascript/" + VERSION;
125125
* // to a slightly smaller value than the one configured in network equipment (load balancer, proxy, firewall,
126126
* // etc. can also limit maximum connection lifetime). No maximum lifetime limit is imposed by default. Zero
127127
* // and negative values result in lifetime not being checked.
128-
* maxConnectionLifetime: 30 * 60 * 1000, // 30 minutes
128+
* maxConnectionLifetime: 60 * 60 * 1000, // 1 hour
129129
*
130130
* // The maximum amount of time to wait to acquire a connection from the pool (to either create a new
131131
* // connection or borrow an existing one.

src/v1/internal/pool-config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* limitations under the License.
1818
*/
1919

20-
const DEFAULT_MAX_SIZE = 50;
20+
const DEFAULT_MAX_SIZE = 100;
2121
const DEFAULT_ACQUISITION_TIMEOUT = 60000;
2222

2323
export default class PoolConfig {

0 commit comments

Comments
 (0)