Files
NodeBB/src/controllers/admin/database.js

43 lines
903 B
JavaScript
Raw Normal View History

2015-09-17 16:25:15 -04:00
'use strict';
var async = require('async');
var nconf = require('nconf');
2017-06-22 19:03:49 -04:00
var databaseController = module.exports;
2015-09-17 16:25:15 -04:00
databaseController.get = function (req, res, next) {
2017-06-22 19:03:49 -04:00
async.waterfall([
function (next) {
async.parallel({
redis: function (next) {
if (nconf.get('redis')) {
var rdb = require('../../database/redis');
rdb.info(rdb.client, next);
} else {
next();
}
},
mongo: function (next) {
if (nconf.get('mongo')) {
var mdb = require('../../database/mongo');
mdb.info(mdb.client, next);
} else {
next();
}
},
postgres: function (next) {
if (nconf.get('postgres')) {
var pdb = require('../../database/postgres');
pdb.info(pdb.pool, next);
} else {
next();
}
},
2017-06-22 19:03:49 -04:00
}, next);
2015-09-17 16:25:15 -04:00
},
2017-06-22 19:03:49 -04:00
function (results) {
res.render('admin/advanced/database', results);
2017-02-17 19:31:21 -07:00
},
2017-06-22 19:03:49 -04:00
], next);
2015-09-17 16:25:15 -04:00
};