pm2
Advanced tools
Comparing version 4.5.0 to 4.5.1
@@ -412,5 +412,3 @@ /** | ||
that.dump(function(err) { | ||
debug('Dumping successfull', err); | ||
that.killDaemon(function() { | ||
debug('------------------ Everything killed', arguments); | ||
that.Client.launchDaemon({interactor:false}, function(err, child) { | ||
@@ -644,4 +642,2 @@ that.Client.launchRPC(function() { | ||
Common.printOut(conf.PREFIX_MSG + '[v] Modules Stopped'); | ||
that._operate('deleteProcessId', 'all', function(err, list) { | ||
@@ -1767,3 +1763,3 @@ Common.printOut(conf.PREFIX_MSG + '[v] All Applications Stopped'); | ||
} | ||
UX.list(list, sys_infos); | ||
UX.list(list, sys_infos, commander); | ||
//Common.printOut(chalk.white.italic(' Use `pm2 show <id|name>` to get more details about an app')); | ||
@@ -1770,0 +1766,0 @@ } |
@@ -27,3 +27,3 @@ | ||
if (diff.length > 0) { | ||
Common.printOut(`Current process list running is not in sync with saved list. ${chalk.italic(diff.join(' '))} differs. Type 'pm2 save' to synchronize.`) | ||
Common.printOut(`Current process list running is not in sync with saved list. App ${chalk.bold(diff.join(' '))} differs. Type 'pm2 save' to synchronize.`) | ||
} | ||
@@ -42,3 +42,3 @@ else if (apps_dumped.length != apps_running.length) { | ||
*/ | ||
function listModulesAndAppsManaged(list) { | ||
function listModulesAndAppsManaged(list, commander) { | ||
var name_col_size = 11 | ||
@@ -123,2 +123,11 @@ | ||
if (commander && commander.sort) { | ||
sort = commander.sort.split(':'); | ||
if(fields[sort[0].toLowerCase()]) { | ||
sortField = sort[0].toLowerCase(); | ||
sortOrder = sort.length === 2 ? sort[1] : 'asc'; | ||
} | ||
} | ||
list.sort(function(a, b) { | ||
@@ -445,3 +454,3 @@ var fieldA = UxHelpers.getNestedProperty(fields[sortField], a) | ||
*/ | ||
module.exports = function(list, sys_infos) { | ||
module.exports = function(list, sys_infos, commander) { | ||
var pm2_conf = Configuration.getSync('pm2') | ||
@@ -452,3 +461,3 @@ | ||
listModulesAndAppsManaged(list) | ||
listModulesAndAppsManaged(list, commander) | ||
@@ -467,3 +476,3 @@ if (sys_infos) { | ||
//checkIfProcessAreDumped(list) | ||
checkIfProcessAreDumped(list) | ||
} |
@@ -66,2 +66,3 @@ 'use strict'; | ||
.option('-c --cron <cron_pattern>', 'restart a running process based on a cron pattern') | ||
.option('-c --cron-restart <cron_pattern>', '(alias) restart a running process based on a cron pattern') | ||
.option('-w --write', 'write configuration in local folder') | ||
@@ -85,2 +86,3 @@ .option('--no-daemon', 'run pm2 daemon in the foreground if it doesn\'t exist already') | ||
.option('--disable-trace', 'disable transaction tracing with km') | ||
.option('--sort <field_name:sort>', 'sort process according to field\'s name') | ||
.option('--attach', 'attach logging after your start/restart/stop/reload') | ||
@@ -345,3 +347,3 @@ .option('--v8', 'enable v8 data collecting') | ||
.action(function(file) { | ||
pm2._startJson(file, commander, 'softReloadProcessId'); | ||
pm2._startJson(file, commander, 'reloadProcessId'); | ||
}); | ||
@@ -348,0 +350,0 @@ |
@@ -81,8 +81,2 @@ /** | ||
return false; | ||
} else if (typeof msg == 'object' && 'cron_restart' in msg) { | ||
return God.restartProcessId({ | ||
id : clu.pm2_env.pm_id | ||
}, function() { | ||
console.log('Application %s has been restarted via CRON', clu.pm2_env.name); | ||
}); | ||
} | ||
@@ -89,0 +83,0 @@ |
@@ -246,9 +246,2 @@ /** | ||
return false; | ||
} else if (typeof msg == 'object' && 'cron_restart' in msg) { | ||
// cron onTick is invoked in the process | ||
return God.restartProcessId({ | ||
id : cspr.pm2_env.pm_id | ||
}, function() { | ||
console.log('Application %s has been restarted via CRON', cspr.pm2_env.name); | ||
}); | ||
} | ||
@@ -255,0 +248,0 @@ |
@@ -33,3 +33,4 @@ /** | ||
console.log('[PM2][WORKER] Registering a cron job on:', pm2_env.pm_id); | ||
var pm_id = pm2_env.pm_id | ||
console.log('[PM2][WORKER] Registering a cron job on:', pm_id); | ||
@@ -39,3 +40,3 @@ var job = new cronJob({ | ||
onTick: function() { | ||
God.softReloadProcessId({id: pm2_env.pm_id}, function(err, data) { | ||
God.restartProcessId({id: pm_id}, function(err, data) { | ||
if (err) | ||
@@ -50,3 +51,3 @@ console.error(err.stack || err); | ||
job.start(); | ||
God.CronJobs.set(God.getCronID(pm2_env.pm_id), job); | ||
God.CronJobs.set(God.getCronID(pm_id), job); | ||
} | ||
@@ -87,3 +88,3 @@ | ||
console.log('[PM2][WORKER] Process %s restarted because it exceeds --max-memory-restart value (current_memory=%s max_memory_limit=%s [octets])', proc.pm2_env.pm_id, proc_key.monit.memory, proc.pm2_env.max_memory_restart); | ||
God.softReloadProcessId({ | ||
God.reloadProcessId({ | ||
id : proc.pm2_env.pm_id | ||
@@ -90,0 +91,0 @@ }, function(err, data) { |
{ | ||
"name": "pm2", | ||
"preferGlobal": true, | ||
"version": "4.5.0", | ||
"version": "4.5.1", | ||
"engines": { | ||
@@ -163,6 +163,6 @@ "node": ">=8.10.0" | ||
"bin": { | ||
"pm2": "./bin/pm2", | ||
"pm2-dev": "./bin/pm2-dev", | ||
"pm2-docker": "./bin/pm2-docker", | ||
"pm2-runtime": "./bin/pm2-runtime" | ||
"pm2": "bin/pm2", | ||
"pm2-dev": "bin/pm2-dev", | ||
"pm2-docker": "bin/pm2-docker", | ||
"pm2-runtime": "bin/pm2-runtime" | ||
}, | ||
@@ -182,3 +182,3 @@ "dependencies": { | ||
"dayjs": "~1.8.25", | ||
"debug": "^4.2.0", | ||
"debug": "^4.3.0", | ||
"enquirer": "2.3.6", | ||
@@ -207,3 +207,3 @@ "eventemitter2": "5.0.1", | ||
"optionalDependencies": { | ||
"systeminformation": "^4.23.3" | ||
"systeminformation": "^4.32" | ||
}, | ||
@@ -210,0 +210,0 @@ "bugs": { |
@@ -12,6 +12,10 @@ <div align="center"> | ||
<a href="https://img.shields.io/npm/dm/pm2" title="PM2 Tests"> | ||
<a href="https://npm-stat.com/charts.html?package=pm2&from=2015-10-09&to=2020-10-09" title="PM2 Downloads"> | ||
<img src="https://img.shields.io/npm/dm/pm2" alt="Downloads per Month"/> | ||
</a> | ||
<a href="https://npm-stat.com/charts.html?package=pm2&from=2015-10-09&to=2020-10-09" title="PM2 Downloads"> | ||
<img src="https://img.shields.io/npm/dy/pm2" alt="Downloads per Year"/> | ||
</a> | ||
<a href="https://badge.fury.io/js/pm2" title="NPM Version Badge"> | ||
@@ -21,6 +25,2 @@ <img src="https://badge.fury.io/js/pm2.svg" alt="npm version"> | ||
<a href="https://img.shields.io/node/v/pm2.svg" title="Node Limitation"> | ||
<img src="https://img.shields.io/node/v/pm2.svg" alt="node version"> | ||
</a> | ||
<a href="https://travis-ci.org/Unitech/pm2" title="PM2 Tests"> | ||
@@ -27,0 +27,0 @@ <img src="https://travis-ci.org/Unitech/pm2.svg?branch=master" alt="Build Status"/> |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
335
861222
131
18415
Updateddebug@^4.3.0