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

Commit

Permalink
feat(db): make database fault tolerant of db server (#1716) r=vladikoff
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmonstar authored and vladikoff committed Mar 17, 2017
1 parent ef8f1c1 commit 5138ad7
Showing 1 changed file with 1 addition and 16 deletions.
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

0 comments on commit 5138ad7

Please sign in to comment.