diff --git a/mysql/mysql-tests.ts b/mysql/mysql-tests.ts index 97df14dbf..080bece2d 100644 --- a/mysql/mysql-tests.ts +++ b/mysql/mysql-tests.ts @@ -222,6 +222,13 @@ var pool = poolCluster.of('SLAVE*', 'RANDOM'); pool.getConnection(function (err, connection) { }); pool.getConnection(function (err, connection) { }); +var poolClusterWithOptions = mysql.createPoolCluster({ + canRetry: true, + removeNodeErrorCount: 3, + restoreNodeTimeout: 1000, + defaultSelector: 'RR' +}); + // destroy poolCluster.end(); diff --git a/mysql/mysql.d.ts b/mysql/mysql.d.ts index 715c799a2..9239c1907 100644 --- a/mysql/mysql.d.ts +++ b/mysql/mysql.d.ts @@ -408,6 +408,12 @@ declare module "mysql" { */ removeNodeErrorCount?: number; + /** + * If connection fails, specifies the number of milliseconds before another connection attempt will be made. + * If set to 0, then node will be removed instead and never re-used. (Default: 0) + */ + restoreNodeTimeout?: number; + /** * The default selector. (Default: RR) * RR: Select one alternately. (Round-Robin)