Skip to content

Commit

Permalink
fix pm2 report when daemon is not running
Browse files Browse the repository at this point in the history
  • Loading branch information
Unitech committed Feb 8, 2022
1 parent 1d46e13 commit 5b896ee
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions lib/API/Extra.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,23 +100,27 @@ module.exports = function(CLI) {
var Log = require('./Log');

that.Client.executeRemote('getReport', {}, function(err, report) {

console.log()
console.log()
console.log()
console.log('```')
fmt.title('PM2 report')
fmt.field('Date', new Date());
fmt.sep();
fmt.title(chalk.bold.blue('Daemon'));
fmt.field('pm2d version', report.pm2_version);
fmt.field('node version', report.node_version);
fmt.field('node path', report.node_path);
fmt.field('argv', report.argv);
fmt.field('argv0', report.argv0);
fmt.field('user', report.user);
fmt.field('uid', report.uid);
fmt.field('gid', report.gid);
fmt.field('uptime', dayjs(new Date()).diff(report.started_at, 'minute') + 'min');

if (report && !err) {
fmt.title(chalk.bold.blue('Daemon'));
fmt.field('pm2d version', report.pm2_version);
fmt.field('node version', report.node_version);
fmt.field('node path', report.node_path);
fmt.field('argv', report.argv);
fmt.field('argv0', report.argv0);
fmt.field('user', report.user);
fmt.field('uid', report.uid);
fmt.field('gid', report.gid);
fmt.field('uptime', dayjs(new Date()).diff(report.started_at, 'minute') + 'min');
}

fmt.sep();
fmt.title(chalk.bold.blue('CLI'));
Expand Down

0 comments on commit 5b896ee

Please sign in to comment.