Skip to content
This repository has been archived by the owner on Apr 3, 2019. It is now read-only.

feat(db): make database fault tolerant of db server #1716

Merged
merged 1 commit into from
Mar 17, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 1 addition & 16 deletions lib/db.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,7 @@ module.exports = function (
}

DB.connect = function (options) {
var db = new DB(options)

return db.pool.get('/')
.then(
function (api) {
// TODO: transition to api version
// patchLevel is mysql specific
if (
api.patchLevel < options.patchLevel ||
api.patchLevel > options.patchLevel + 1
) {
throw error.dbIncorrectPatchLevel(api.patchLevel, options.patchLevel)
}
return db
}
)
return P.resolve(new DB(options))
}

DB.prototype.close = function () {
Expand Down