rbt_mssql-pool-party
Version:
Extension of mssql that provides management of multiple connection pools, dsns, retries, and more
12 lines (11 loc) • 728 B
JavaScript
;Object.defineProperty(exports, "__esModule", { value: true });exports["default"] = serialWarmupStrategy; // The serialWarmupStrategy attempts to create connection pools in series, based
// on the order of the dsns provided.
// This isn't a very good strategy to use in practice, but it can be useful for testing
function serialWarmupStrategy(dsns, connectionPoolFactory, onCreation, onError) {
return dsns.reduce(function (p, dsn) {return p.then(
function () {return connectionPoolFactory(dsn).then(
function (pool) {return onCreation(pool);},
function (err) {return onError(err);});});},
Promise.resolve());
}module.exports = exports.default;
//# sourceMappingURL=serial-warmup-strategy.js.map