Skip to content
Snippets Groups Projects
Commit 4bd95e99 authored by jonasled's avatar jonasled
Browse files

Fixed disconnect calling itself, instead of the db connection and added releaes command.

parent f44dc5b8
No related branches found
No related tags found
No related merge requests found
......@@ -97,7 +97,19 @@ DB.prototype.execute = function(query, params) {
*/
DB.prototype.end = function() {
var db = this;
db.end();
db.pool.getConnection(function(err, con) {
con.release();
});
};
/**
* Disconnect from database
*/
DB.prototype.release = function() {
var db = this;
db.pool.getConnection(function(err, con) {
con.release();
});
};
module.exports = function(name) {
......@@ -108,4 +120,4 @@ module.exports = function(name) {
}
return instances[name];
};
\ No newline at end of file
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment