forked from GitHub/dbot
fix indentation
This commit is contained in:
parent
10c300ff2b
commit
81520a3aab
22
database.js
22
database.js
@ -15,19 +15,19 @@ var DatabaseDriver = function(config) {
|
|||||||
* Connect to or create a new DataBank
|
* Connect to or create a new DataBank
|
||||||
*/
|
*/
|
||||||
DatabaseDriver.prototype.createDB = function(name, driver, schema, callback) {
|
DatabaseDriver.prototype.createDB = function(name, driver, schema, callback) {
|
||||||
var params = { 'schema': schema };
|
var params = { 'schema': schema };
|
||||||
|
|
||||||
if(driver == 'redis' && _.has(this.config, 'redisPort')) params.port = this.config.redisPort;
|
if(driver == 'redis' && _.has(this.config, 'redisPort')) params.port = this.config.redisPort;
|
||||||
if(driver == 'disk') params.dir = 'db';
|
if(driver == 'disk') params.dir = 'db';
|
||||||
|
|
||||||
this.databank = Databank.get(driver, params);
|
this.databank = Databank.get(driver, params);
|
||||||
this.databank.connect({}, function(err) {
|
this.databank.connect({}, function(err) {
|
||||||
if(err) {
|
if(err) {
|
||||||
console.log('Didn\'t manage to connect to the data source - ' + err);
|
console.log('Didn\'t manage to connect to the data source - ' + err);
|
||||||
} else {
|
} else {
|
||||||
callback(this.databank);
|
callback(this.databank);
|
||||||
}
|
}
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.DatabaseDriver = DatabaseDriver;
|
exports.DatabaseDriver = DatabaseDriver;
|
||||||
|
Loading…
Reference in New Issue
Block a user