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
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmonstar committed Mar 15, 2017
1 parent 1a907f7 commit f6c7806
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 f6c7806

Please sign in to comment.