123456789101112131415161718192021222324252627282930313233 |
- var ConnectionConfig = require('./ConnectionConfig');
- module.exports = PoolConfig;
- function PoolConfig(options) {
- if (typeof options === 'string') {
- options = ConnectionConfig.parseUrl(options);
- }
- this.acquireTimeout = (options.acquireTimeout === undefined)
- ? 10 * 1000
- : Number(options.acquireTimeout);
- this.connectionConfig = new ConnectionConfig(options);
- this.waitForConnections = (options.waitForConnections === undefined)
- ? true
- : Boolean(options.waitForConnections);
- this.connectionLimit = (options.connectionLimit === undefined)
- ? 10
- : Number(options.connectionLimit);
- this.queueLimit = (options.queueLimit === undefined)
- ? 0
- : Number(options.queueLimit);
- }
- PoolConfig.prototype.newConnectionConfig = function newConnectionConfig() {
- var connectionConfig = new ConnectionConfig(this.connectionConfig);
- connectionConfig.clientFlags = this.connectionConfig.clientFlags;
- connectionConfig.maxPacketSize = this.connectionConfig.maxPacketSize;
- return connectionConfig;
- };
|