Skip to content

Commit

Permalink
fix: use nconf instead of requiring config.json
Browse files Browse the repository at this point in the history
  • Loading branch information
oplik0 committed Jul 14, 2022
1 parent 76772b3 commit 34b86b7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/cli/manage.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,12 @@ async function info() {
const hash = childProcess.execSync('git rev-parse HEAD');
console.log(` git hash: ${hash}`);

const config = require('../../config.json');
console.log(` database: ${config.database}`);
console.log(` database: ${nconf.get('database')}`);

await db.init();
const info = await db.info(db.client);

switch (config.database) {
switch (nconf.get('database')) {
case 'redis':
console.log(` version: ${info.redis_version}`);
console.log(` disk sync: ${info.rdb_last_bgsave_status}`);
Expand All @@ -128,6 +127,10 @@ async function info() {
console.log(` version: ${info.version}`);
console.log(` engine: ${info.storageEngine}`);
break;
case 'postges':
console.log(` version: ${info.version}`);
console.log(` uptime: ${info.uptime}`);
break;
}

const analyticsData = await analytics.getHourlyStatsForSet('analytics:pageviews', Date.now(), 24);
Expand Down

0 comments on commit 34b86b7

Please sign in to comment.