rbt_mssql-pool-party
Version:
Extension of mssql that provides management of multiple connection pools, dsns, retries, and more
14 lines • 562 B
JavaScript
;Object.defineProperty(exports, "__esModule", { value: true });exports["default"] = poolPrioritySort;function poolPrioritySort(a, b) {
if (a.connection.connected && !b.connection.connected) {
return -1;
}
if (!a.connection.connected && b.connection.connected) {
return 1;
}
if (!a.connection.connected && !b.connection.connected) {
return 0;
}
// if both pools are connected, then we sort by priority
return a.dsn.priority - b.dsn.priority;
}module.exports = exports.default;
//# sourceMappingURL=pool-priority-sort.js.map